agentic-qe 3.9.30 → 3.9.32

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 (345) hide show
  1. package/.claude/skills/skills-manifest.json +1 -1
  2. package/CHANGELOG.md +208 -0
  3. package/assets/skills/skills-manifest.json +1 -1
  4. package/dist/bridge/captured-experience-bridge.js +31 -2
  5. package/dist/cli/bundle.js +5 -5
  6. package/dist/cli/chunks/adapter-CDQOF5TF.js +2 -0
  7. package/dist/cli/chunks/{agent-booster-wasm-TOSXWTUQ.js → agent-booster-wasm-WKS3E6KT.js} +2 -2
  8. package/dist/cli/chunks/{agent-handler-2BU6TYZZ.js → agent-handler-LYCAWE7S.js} +2 -2
  9. package/dist/cli/chunks/{agent-memory-branch-JFG3BXZY.js → agent-memory-branch-XF7IOMRK.js} +2 -2
  10. package/dist/cli/chunks/aqe-learning-engine-RZK22CJB.js +2 -0
  11. package/dist/cli/chunks/{audit-4IGZZKUW.js → audit-D2AY3HFP.js} +2 -2
  12. package/dist/cli/chunks/base-UGH6TVO4.js +2 -0
  13. package/dist/cli/chunks/{hnswlib-node-STKRZIU3.js → better-sqlite3-K2VWFDKT.js} +2 -2
  14. package/dist/cli/chunks/{brain-handler-RIDW27HH.js → brain-handler-NNW4TAO2.js} +4 -4
  15. package/dist/cli/chunks/{branch-enumerator-GMYHLLWD.js → branch-enumerator-OM5HNZKV.js} +2 -2
  16. package/dist/cli/chunks/{browser-N76A3I2P.js → browser-Y2FU2NV4.js} +2 -2
  17. package/dist/cli/chunks/browser-workflow-SGOL3FCJ.js +2 -0
  18. package/dist/cli/chunks/{chunk-ETEHVG76.js → chunk-2L5GAOST.js} +2 -2
  19. package/dist/cli/chunks/{chunk-ECX6VXMW.js → chunk-2XC4XVCI.js} +1 -1
  20. package/dist/cli/chunks/{chunk-L7X3A36M.js → chunk-2Z2IQBIJ.js} +1 -1
  21. package/dist/cli/chunks/{chunk-UYLHIGNC.js → chunk-33PGBYTC.js} +2 -2
  22. package/dist/cli/chunks/{chunk-OOFWYDG6.js → chunk-3MHWBCSC.js} +1 -1
  23. package/dist/cli/chunks/{chunk-FI4HRS2G.js → chunk-3R4CMTWF.js} +2 -2
  24. package/dist/cli/chunks/{chunk-IP6ZTXNJ.js → chunk-45N22VAB.js} +2 -2
  25. package/dist/cli/chunks/{chunk-FG5GL26L.js → chunk-4H4PEZUX.js} +2 -2
  26. package/dist/cli/chunks/{chunk-CNNVL5W4.js → chunk-4VAZSCTZ.js} +2 -2
  27. package/dist/cli/chunks/{chunk-AWWD3EI3.js → chunk-5A6LBGRU.js} +2 -2
  28. package/dist/cli/chunks/{chunk-ER6BT4GS.js → chunk-5DSANX6S.js} +2 -2
  29. package/dist/cli/chunks/chunk-5R5WOLZM.js +5 -0
  30. package/dist/cli/chunks/{chunk-RNO6CE7I.js → chunk-5WR42V5O.js} +2 -2
  31. package/dist/cli/chunks/{chunk-UEXOMDRS.js → chunk-5XY6SULI.js} +2 -2
  32. package/dist/cli/chunks/{chunk-WVODEWH5.js → chunk-62UXGD5J.js} +14 -8
  33. package/dist/cli/chunks/{chunk-EWNJ6OAT.js → chunk-667I4RTC.js} +1 -1
  34. package/dist/cli/chunks/{chunk-ND6VCNN5.js → chunk-6EKXBWJD.js} +2 -2
  35. package/dist/cli/chunks/{chunk-Y57V4FDT.js → chunk-6R6QCGNU.js} +2 -2
  36. package/dist/cli/chunks/{chunk-VRP4GB4Y.js → chunk-6SYP7QX6.js} +4 -4
  37. package/dist/cli/chunks/{chunk-BFJLKG3D.js → chunk-6YGFAJ3X.js} +1 -1
  38. package/dist/cli/chunks/{chunk-UWWX4RK7.js → chunk-6ZG6TBWF.js} +4 -4
  39. package/dist/cli/chunks/{chunk-QSV4ROZD.js → chunk-7AISRWBS.js} +2 -2
  40. package/dist/cli/chunks/{chunk-SJCEPKZO.js → chunk-7IDPVSTF.js} +1 -1
  41. package/dist/cli/chunks/{chunk-HQIWLMDS.js → chunk-7PTW3M67.js} +2 -2
  42. package/dist/cli/chunks/{chunk-TA3QYAZ6.js → chunk-A4UNK5SY.js} +2 -2
  43. package/dist/cli/chunks/chunk-A6VI5BZU.js +95 -0
  44. package/dist/cli/chunks/{chunk-XVTZXCHI.js → chunk-BBPOTFIY.js} +2 -2
  45. package/dist/cli/chunks/{chunk-OEGFOMXP.js → chunk-BDXEL3GM.js} +2 -2
  46. package/dist/cli/chunks/{chunk-YETPSL6H.js → chunk-BGRC4676.js} +3 -3
  47. package/dist/cli/chunks/chunk-BQML7B4W.js +180 -0
  48. package/dist/cli/chunks/{chunk-DEDFPHJL.js → chunk-BV3SGEV7.js} +1 -1
  49. package/dist/cli/chunks/{chunk-FGMHVSLV.js → chunk-DBE2LIYG.js} +2 -2
  50. package/dist/cli/chunks/{chunk-2GBBZLXT.js → chunk-DFY7F4TE.js} +1 -1
  51. package/dist/cli/chunks/{chunk-LDGNVPBZ.js → chunk-EFEJLZDN.js} +1 -1
  52. package/dist/cli/chunks/{chunk-ZKZTSYPU.js → chunk-ESNBKAT6.js} +2 -2
  53. package/dist/cli/chunks/{chunk-5F26LSG2.js → chunk-EVSUZKD5.js} +2 -2
  54. package/dist/cli/chunks/{chunk-QOJ7EAF5.js → chunk-FFBF5BLQ.js} +1 -1
  55. package/dist/cli/chunks/{chunk-3AICELMQ.js → chunk-FIONYUVH.js} +2 -2
  56. package/dist/cli/chunks/{chunk-UROPIIB2.js → chunk-FNQCWEVJ.js} +2 -2
  57. package/dist/cli/chunks/{chunk-5DJAJPBG.js → chunk-FV2MU6CY.js} +2 -2
  58. package/dist/cli/chunks/{chunk-QTS2DS42.js → chunk-FWEYOD3S.js} +2 -2
  59. package/dist/cli/chunks/{chunk-XK6YXCS7.js → chunk-G6AJMFWL.js} +3 -3
  60. package/dist/cli/chunks/{chunk-R57J3O6I.js → chunk-G6VVOUUF.js} +2 -2
  61. package/dist/cli/chunks/{chunk-2O5TT3UT.js → chunk-G77CYF7H.js} +3 -3
  62. package/dist/cli/chunks/{chunk-TULNR2AH.js → chunk-H7YKTJMY.js} +2 -2
  63. package/dist/cli/chunks/{chunk-GEXVUFK4.js → chunk-HGWQC7PR.js} +2 -2
  64. package/dist/cli/chunks/{chunk-QLNS6DGB.js → chunk-HHBFI3YA.js} +2 -2
  65. package/dist/cli/chunks/{chunk-WP6X67YI.js → chunk-HPQZSXED.js} +1 -1
  66. package/dist/cli/chunks/{chunk-HA7N45KB.js → chunk-HR6NX6DW.js} +2 -2
  67. package/dist/cli/chunks/{chunk-HB52S6IV.js → chunk-I6Q6BPVH.js} +1 -1
  68. package/dist/cli/chunks/{chunk-BM73MJLE.js → chunk-IGEZVFOM.js} +2 -2
  69. package/dist/cli/chunks/{chunk-QBDXUI2H.js → chunk-IGQPGXP7.js} +2 -2
  70. package/dist/cli/chunks/{chunk-Q26GG6WO.js → chunk-IJQJV7BC.js} +3 -3
  71. package/dist/cli/chunks/chunk-JDW6GN3A.js +2 -0
  72. package/dist/cli/chunks/{chunk-GZ3U2QT2.js → chunk-JRYNHFZA.js} +1 -1
  73. package/dist/cli/chunks/{chunk-MV3NUANS.js → chunk-KHZRNJ3A.js} +1 -1
  74. package/dist/cli/chunks/chunk-LHDTXTS7.js +2 -0
  75. package/dist/cli/chunks/{chunk-52TRKIAQ.js → chunk-LI2IOJMM.js} +1 -1
  76. package/dist/cli/chunks/{heartbeat-scheduler-CNJBAO5C.js → chunk-LR5VW3OS.js} +2 -2
  77. package/dist/cli/chunks/{chunk-2NFGUFYU.js → chunk-LTSNDM5N.js} +2 -2
  78. package/dist/cli/chunks/{chunk-3EP2YZSY.js → chunk-M5PYPGBC.js} +2 -2
  79. package/dist/cli/chunks/{chunk-JCWHX4XV.js → chunk-MEHNT37H.js} +2 -2
  80. package/dist/cli/chunks/{chunk-QHKK2H4H.js → chunk-MERMCKPG.js} +1 -1
  81. package/dist/cli/chunks/{chunk-Q53UMLLC.js → chunk-MIHQIAVK.js} +2 -2
  82. package/dist/cli/chunks/{chunk-VOBNJWZF.js → chunk-MMVSERJQ.js} +2 -2
  83. package/dist/cli/chunks/{chunk-37I6K7QO.js → chunk-MQQANXFS.js} +2 -2
  84. package/dist/cli/chunks/{chunk-YKFURJNP.js → chunk-MTOHV22P.js} +1 -1
  85. package/dist/cli/chunks/{chunk-MOLOWMON.js → chunk-NVZHCAEB.js} +2 -2
  86. package/dist/cli/chunks/{chunk-YXR5RYRE.js → chunk-NW5FYGDE.js} +2 -2
  87. package/dist/cli/chunks/{chunk-NMBHF7ZD.js → chunk-NZRJWK5H.js} +61 -121
  88. package/dist/cli/chunks/chunk-O5NEZCTB.js +2 -0
  89. package/dist/cli/chunks/{chunk-E7UHOKKL.js → chunk-O5UGJ3OI.js} +2 -2
  90. package/dist/cli/chunks/{chunk-Q4HJRYQB.js → chunk-OK2TFTXP.js} +2 -2
  91. package/dist/cli/chunks/{chunk-FGDEM4HU.js → chunk-OKEHGXIS.js} +2 -2
  92. package/dist/cli/chunks/{chunk-C6TNYLD7.js → chunk-OKRY4LNE.js} +3 -3
  93. package/dist/cli/chunks/{chunk-3WIU2E2Y.js → chunk-OMOGD2NN.js} +2 -2
  94. package/dist/cli/chunks/{chunk-DJRWVNHK.js → chunk-ONNTJXU7.js} +2 -2
  95. package/dist/cli/chunks/chunk-OPOGZAN5.js +14 -0
  96. package/dist/cli/chunks/{chunk-OTFJCZNY.js → chunk-PG5F2VHA.js} +2 -2
  97. package/dist/cli/chunks/{chunk-MYF7F3ZP.js → chunk-PHRMWRXA.js} +2 -2
  98. package/dist/cli/chunks/{chunk-7D2DM23U.js → chunk-PIXUX2NR.js} +2 -2
  99. package/dist/cli/chunks/{chunk-IWC6GR24.js → chunk-PLGMPG7S.js} +2 -2
  100. package/dist/cli/chunks/{chunk-T2DIMSQF.js → chunk-PPS6VN24.js} +1 -1
  101. package/dist/cli/chunks/{chunk-AUNNGKLN.js → chunk-PQAYCK2U.js} +2 -2
  102. package/dist/cli/chunks/{chunk-FU74OETU.js → chunk-PS6ISBED.js} +2 -2
  103. package/dist/cli/chunks/{chunk-JNRRDG7O.js → chunk-QPYNQSWD.js} +2 -2
  104. package/dist/cli/chunks/{chunk-MHPK4ZPK.js → chunk-QRTZ67BC.js} +2 -2
  105. package/dist/cli/chunks/{chunk-Z3TXQOS7.js → chunk-REW3W3ZW.js} +1 -1
  106. package/dist/cli/chunks/{chunk-3PZDXE5E.js → chunk-RHXYZ6AZ.js} +127 -127
  107. package/dist/cli/chunks/{chunk-IEGAEXQX.js → chunk-RZXAXWBD.js} +2 -2
  108. package/dist/cli/chunks/{chunk-4UZQSPR4.js → chunk-S4M7U6CZ.js} +2 -2
  109. package/dist/cli/chunks/{chunk-H27XUYWZ.js → chunk-SJETAUZA.js} +1 -1
  110. package/dist/cli/chunks/{chunk-MZ7M2CDV.js → chunk-SLH7LFVY.js} +2 -2
  111. package/dist/cli/chunks/{chunk-6EP3GHED.js → chunk-SRJ5N7LD.js} +2 -2
  112. package/dist/cli/chunks/{chunk-XDYTQPJM.js → chunk-T5ADVYPH.js} +1 -1
  113. package/dist/cli/chunks/{chunk-TYZGEVP6.js → chunk-THYGFSTA.js} +12 -6
  114. package/dist/cli/chunks/{chunk-XKH4E2IQ.js → chunk-TX2DBLTL.js} +1 -1
  115. package/dist/cli/chunks/{chunk-HJDHQBMJ.js → chunk-UJMGNO6L.js} +1 -1
  116. package/dist/cli/chunks/{chunk-MCXRS2TZ.js → chunk-UUQ3SOKM.js} +1 -1
  117. package/dist/cli/chunks/{chunk-USN2JKUW.js → chunk-V5RLGPEW.js} +2 -2
  118. package/dist/cli/chunks/chunk-V6HM2BKJ.js +2 -0
  119. package/dist/cli/chunks/{chunk-R5IW5ARI.js → chunk-V7I6FTLG.js} +1 -1
  120. package/dist/cli/chunks/{chunk-2MKSEL6F.js → chunk-V7ZBPSVG.js} +1 -1
  121. package/dist/cli/chunks/{chunk-IOINZWNA.js → chunk-VJL7DNUU.js} +29 -17
  122. package/dist/cli/chunks/{chunk-JCDEMPJS.js → chunk-VKCWWR6C.js} +1 -1
  123. package/dist/cli/chunks/chunk-VKNCMGOJ.js +29 -0
  124. package/dist/cli/chunks/{chunk-GRPEDIYG.js → chunk-W2VTHUDK.js} +2 -2
  125. package/dist/cli/chunks/{chunk-SAVITYEX.js → chunk-W3JB3G7C.js} +2 -2
  126. package/dist/cli/chunks/{chunk-WTXRPYNN.js → chunk-WQ4MT74X.js} +1 -1
  127. package/dist/cli/chunks/{chunk-GY4EGQO3.js → chunk-WTNM7NA4.js} +1 -1
  128. package/dist/cli/chunks/chunk-XB3SIYGU.js +62 -0
  129. package/dist/cli/chunks/{chunk-IHRFR5SV.js → chunk-XCUNQ3FK.js} +2 -2
  130. package/dist/cli/chunks/{chunk-ITBPDVK5.js → chunk-XHQFVTFD.js} +1 -1
  131. package/dist/cli/chunks/{chunk-KJZXBZQR.js → chunk-YBUUAFKR.js} +1 -1
  132. package/dist/cli/chunks/{chunk-KR2PGNXX.js → chunk-YJV6TTCW.js} +2 -2
  133. package/dist/cli/chunks/{chunk-BQLFOJ5G.js → chunk-YUSGT2CU.js} +1 -1
  134. package/dist/cli/chunks/{chunk-5E3YCZC5.js → chunk-YUTSN5BK.js} +2 -2
  135. package/dist/cli/chunks/{chunk-DDMFTEJP.js → chunk-YVMJTBXB.js} +3 -3
  136. package/dist/cli/chunks/chunk-YVQ4PR4H.js +2 -0
  137. package/dist/cli/chunks/{chunk-RYMHYTOK.js → chunk-Z2EDNMCQ.js} +3 -3
  138. package/dist/cli/chunks/{chunk-QNSUPXUU.js → chunk-ZESMMAKZ.js} +2 -2
  139. package/dist/cli/chunks/chunk-ZIVOT3B7.js +2 -0
  140. package/dist/cli/chunks/{ci-BYCH3NPL.js → ci-NSF6OHB4.js} +2 -2
  141. package/dist/cli/chunks/{ci-output-P7P4XH6F.js → ci-output-ZPDJ42U3.js} +2 -2
  142. package/dist/cli/chunks/{circuit-breaker-VLX556ZI.js → circuit-breaker-Y2RUJDYG.js} +2 -2
  143. package/dist/cli/chunks/{claude-flow-setup-JPR425PL.js → claude-flow-setup-OH6G6KM2.js} +2 -2
  144. package/dist/cli/chunks/client-QQGRKAY7.js +2 -0
  145. package/dist/cli/chunks/{cline-installer-FOY47NSH.js → cline-installer-IHH4F27G.js} +2 -2
  146. package/dist/cli/chunks/{code-57SN4ZDY.js → code-SFAHWFTX.js} +2 -2
  147. package/dist/cli/chunks/{code-index-extractor-GT7UFRYU.js → code-index-extractor-GXECMOM2.js} +2 -2
  148. package/dist/cli/chunks/{codex-installer-JAGWONAV.js → codex-installer-UPMSAFCQ.js} +2 -2
  149. package/dist/cli/chunks/{completions-7YLHPGSV.js → completions-5TX6LDHY.js} +2 -2
  150. package/dist/cli/chunks/{complexity-analyzer-TQUF6BEI.js → complexity-analyzer-J2ZR3XZB.js} +2 -2
  151. package/dist/cli/chunks/{continuedev-installer-TICV6IGT.js → continuedev-installer-GWYZKB5A.js} +2 -2
  152. package/dist/cli/chunks/{copilot-installer-A6PDMI52.js → copilot-installer-DQZMQWI7.js} +2 -2
  153. package/dist/cli/chunks/{cost-tracker-NZPNHNV2.js → cost-tracker-V7KIGCLZ.js} +2 -2
  154. package/dist/cli/chunks/{coverage-HBEB2LKS.js → coverage-3X6LA2GZ.js} +3 -3
  155. package/dist/cli/chunks/cross-domain-router-3SHAGRVP.js +2 -0
  156. package/dist/cli/chunks/{cursor-installer-R4FM7MGN.js → cursor-installer-ENDG4JIU.js} +2 -2
  157. package/dist/cli/chunks/daemon-4XVAO7GT.js +16 -0
  158. package/dist/cli/chunks/daemon-TC65CQFK.js +10 -0
  159. package/dist/cli/chunks/{dag-attention-scheduler-2L7VCYZ3.js → dag-attention-scheduler-JOSCDRZC.js} +2 -2
  160. package/dist/cli/chunks/{detect-EEWB4IYE.js → detect-KWZX3OMK.js} +2 -2
  161. package/dist/cli/chunks/{dist-node-7RM6BB2X.js → dist-node-R4U2PJ47.js} +2 -2
  162. package/dist/cli/chunks/{domain-handler-RVGHBDUJ.js → domain-handler-BMYYZO2L.js} +2 -2
  163. package/dist/cli/chunks/{domain-transfer-M5MERQG5.js → domain-transfer-MSDBBDLC.js} +2 -2
  164. package/dist/cli/chunks/dream-OCZK42FM.js +2 -0
  165. package/dist/cli/chunks/{embed-and-insert-pattern-MS55QS73.js → embed-and-insert-pattern-MFINPOLS.js} +2 -2
  166. package/dist/cli/chunks/{eval-MBTMI7KN.js → eval-OER6UNUY.js} +2 -2
  167. package/dist/cli/chunks/{experience-capture-middleware-Z5XB7D6A.js → experience-capture-middleware-F5I77ECG.js} +3 -3
  168. package/dist/cli/chunks/{fast-paths-FSWLHI4I.js → fast-paths-P3KT5DUQ.js} +2 -2
  169. package/dist/cli/chunks/{feature-flags-QUPNH2J5.js → feature-flags-5EBWQ5WU.js} +2 -2
  170. package/dist/cli/chunks/{feature-flags-ATYOPR5D.js → feature-flags-DYFZSQLV.js} +2 -2
  171. package/dist/cli/chunks/{file-discovery-SOJJEQ2E.js → file-discovery-MOBVABSM.js} +2 -2
  172. package/dist/cli/chunks/{fleet-PWBTDWVG.js → fleet-J3R3NQNC.js} +3 -3
  173. package/dist/cli/chunks/{gnn-wrapper-2N67VQOQ.js → gnn-wrapper-QD76SULF.js} +2 -2
  174. package/dist/cli/chunks/{heartbeat-handler-5PSG2UPO.js → heartbeat-handler-AJEWTPZ4.js} +4 -4
  175. package/dist/cli/chunks/heartbeat-scheduler-EAVZR6TJ.js +2 -0
  176. package/dist/cli/chunks/hnsw-adapter-BY4XB7FB.js +2 -0
  177. package/dist/cli/chunks/hnsw-index-657CZRG7.js +2 -0
  178. package/dist/cli/chunks/{hnsw-legacy-bridge-YIXH5T4U.js → hnsw-legacy-bridge-5VRM5N7K.js} +2 -2
  179. package/dist/cli/chunks/{better-sqlite3-3U2AVWQ3.js → hnswlib-node-BWUH4OQT.js} +2 -2
  180. package/dist/cli/chunks/hooks-7PMVKQOE.js +248 -0
  181. package/dist/cli/chunks/{hybrid-router-RL47S47Z.js → hybrid-router-2K2LW45J.js} +2 -2
  182. package/dist/cli/chunks/{hypergraph-engine-XW2IHFWW.js → hypergraph-engine-2CQ735JO.js} +2 -2
  183. package/dist/cli/chunks/{hypergraph-handler-AQXKY4UF.js → hypergraph-handler-AQ53GVIW.js} +3 -3
  184. package/dist/cli/chunks/impact-analyzer-GI6UVAMT.js +2 -0
  185. package/dist/cli/chunks/{init-handler-KXYGJQI5.js → init-handler-ZOVJPAWO.js} +6 -6
  186. package/dist/cli/chunks/init-wizard-HOH577MH.js +2 -0
  187. package/dist/cli/chunks/kernel-JDYBG5GE.js +2 -0
  188. package/dist/cli/chunks/{kilocode-installer-VSULDGRO.js → kilocode-installer-GWQCNLKI.js} +2 -2
  189. package/dist/cli/chunks/{kiro-installer-SH4D2UXW.js → kiro-installer-6KVES4MO.js} +2 -2
  190. package/dist/cli/chunks/knowledge-graph-RAQOWLG3.js +2 -0
  191. package/dist/cli/chunks/learning-6XMNWXRT.js +117 -0
  192. package/dist/cli/chunks/{llm-router-YXXSQX5K.js → llm-router-GS4AZJJC.js} +4 -4
  193. package/dist/cli/chunks/{load-S52R2SLL.js → load-FEMEQNE6.js} +2 -2
  194. package/dist/cli/chunks/load-test-3MEJ43U2.js +2 -0
  195. package/dist/cli/chunks/{mcp-ZWMAJIU7.js → mcp-6V2H7EXU.js} +2 -2
  196. package/dist/cli/chunks/{memory-4YTWWDK7.js → memory-YLGPOB2H.js} +5 -5
  197. package/dist/cli/chunks/memory-backend-2A47ZRGO.js +2 -0
  198. package/dist/cli/chunks/memory-handlers-UBTBC7D2.js +2 -0
  199. package/dist/cli/chunks/{multi-model-executor-F3VEM2UF.js → multi-model-executor-SL2EKAH2.js} +2 -2
  200. package/dist/cli/chunks/{opencode-installer-Z2CUJQ6D.js → opencode-installer-ADOJVGNA.js} +2 -2
  201. package/dist/cli/chunks/{orchestrator-UPXR2XOF.js → orchestrator-O4IWW2VU.js} +37 -18
  202. package/dist/cli/chunks/{pipeline-6MEMAIXM.js → pipeline-5BD5YQNQ.js} +2 -2
  203. package/dist/cli/chunks/{platform-H72FLOM7.js → platform-HXSUOOJH.js} +2 -2
  204. package/dist/cli/chunks/{plugin-GIMQFDVR.js → plugin-HOLH5CUH.js} +2 -2
  205. package/dist/cli/chunks/{prime-radiant-advanced-wasm-DM5FR5SV.js → prime-radiant-advanced-wasm-PJTL7OLS.js} +2 -2
  206. package/dist/cli/chunks/protocol-executor-3FR7FBVM.js +2 -0
  207. package/dist/cli/chunks/{protocol-handler-YW3N333B.js → protocol-handler-K27YGLC7.js} +2 -2
  208. package/dist/cli/chunks/{prove-IJY524KK.js → prove-MHCLHQQ6.js} +2 -2
  209. package/dist/cli/chunks/{provider-manager-FNG6YR2V.js → provider-manager-3645PPXX.js} +2 -2
  210. package/dist/cli/chunks/qe-reasoning-bank-CHNYPYQW.js +2 -0
  211. package/dist/cli/chunks/{quality-EZLAMSCP.js → quality-NDE6EDOY.js} +2 -2
  212. package/dist/cli/chunks/queen-coordinator-J6ZRYTBX.js +2 -0
  213. package/dist/cli/chunks/{real-embeddings-MFRCC6GH.js → real-embeddings-VD3EVV3U.js} +2 -2
  214. package/dist/cli/chunks/{roocode-installer-H3ZIRGWU.js → roocode-installer-63Y45UUG.js} +2 -2
  215. package/dist/cli/chunks/router-23HRN2Z6.js +2 -0
  216. package/dist/cli/chunks/routing-feedback-R6A4B6ZG.js +2 -0
  217. package/dist/cli/chunks/{routing-handler-T2A7FYHW.js → routing-handler-76XISU2E.js} +2 -2
  218. package/dist/cli/chunks/{ruvector-commands-TCLWBP2M.js → ruvector-commands-AEKOZZHZ.js} +2 -2
  219. package/dist/cli/chunks/{rvf-dual-writer-BE3JCPYC.js → rvf-dual-writer-4DMUIZQF.js} +2 -2
  220. package/dist/cli/chunks/{rvf-migration-adapter-MLUX5YGR.js → rvf-migration-adapter-YUTXFOZ3.js} +2 -2
  221. package/dist/cli/chunks/{rvf-migration-coordinator-OAQXTASZ.js → rvf-migration-coordinator-XJ5N2W37.js} +2 -2
  222. package/dist/cli/chunks/rvf-native-adapter-QINEJZM7.js +2 -0
  223. package/dist/cli/chunks/safe-db-YXMCSKFH.js +2 -0
  224. package/dist/cli/chunks/schedule-XVFD27P5.js +2 -0
  225. package/dist/cli/chunks/scheduler-NWH2IDEU.js +2 -0
  226. package/dist/cli/chunks/{security-SHWJWJ4M.js → security-6YS6GQGO.js} +3 -3
  227. package/dist/cli/chunks/shared-rvf-adapter-FTZY35WI.js +2 -0
  228. package/dist/cli/chunks/{shared-rvf-dual-writer-BKSR2FFK.js → shared-rvf-dual-writer-MH2Y65HA.js} +2 -2
  229. package/dist/cli/chunks/sqlite-persistence-BR6YJF5P.js +2 -0
  230. package/dist/cli/chunks/{status-handler-QK5KMKYC.js → status-handler-57JQMPY5.js} +2 -2
  231. package/dist/cli/chunks/{structural-health-3BRNCAYQ.js → structural-health-34D5VWRD.js} +2 -2
  232. package/dist/cli/chunks/sync-HJD2US5P.js +2 -0
  233. package/dist/cli/chunks/sync-TTQ6ZB5D.js +17 -0
  234. package/dist/cli/chunks/{task-handler-VH2CLUIA.js → task-handler-4RF57637.js} +2 -2
  235. package/dist/cli/chunks/{task-handlers-BUZNV2VX.js → task-handlers-BRSK7HDE.js} +3 -3
  236. package/dist/cli/chunks/{test-K24JQQZ2.js → test-GMUW2VR3.js} +4 -4
  237. package/dist/cli/chunks/{test-scheduling-MHXRV5VI.js → test-scheduling-7LF24IFV.js} +3 -3
  238. package/dist/cli/chunks/{token-bootstrap-3NZDLG52.js → token-bootstrap-VYT4RTHU.js} +2 -2
  239. package/dist/cli/chunks/{token-usage-C4BGA2O7.js → token-usage-NFNCPQGW.js} +2 -2
  240. package/dist/cli/chunks/{transformers-ZIIFB2V4.js → transformers-GGD5GIEY.js} +2 -2
  241. package/dist/cli/chunks/{tree-sitter-wasm-parser-GES2AV7A.js → tree-sitter-wasm-parser-GKYG6NKT.js} +2 -2
  242. package/dist/cli/chunks/{types-L3MO5VNC.js → types-WJ3ZTRD5.js} +2 -2
  243. package/dist/cli/chunks/unified-memory-AT3Z4CY7.js +2 -0
  244. package/dist/cli/chunks/unified-memory-hnsw-6FOIGINN.js +2 -0
  245. package/dist/cli/chunks/unified-persistence-TCJB7MQS.js +2 -0
  246. package/dist/cli/chunks/{upgrade-EKJYS5S5.js → upgrade-IMBT4F6K.js} +2 -2
  247. package/dist/cli/chunks/{validate-WYWWB5PQ.js → validate-76OVF45Z.js} +2 -2
  248. package/dist/cli/chunks/{validate-swarm-SBSWKJ3H.js → validate-swarm-HH2ZYWXA.js} +2 -2
  249. package/dist/cli/chunks/{vibium-VEMTLNFV.js → vibium-74WQNDBX.js} +2 -2
  250. package/dist/cli/chunks/visual-security-IBAUX2K5.js +2 -0
  251. package/dist/cli/chunks/{web-tree-sitter-STW2WR2J.js → web-tree-sitter-W6RGE4SL.js} +2 -2
  252. package/dist/cli/chunks/{windsurf-installer-6ZXMJASZ.js → windsurf-installer-7DMSFCA2.js} +2 -2
  253. package/dist/cli/chunks/{witness-chain-PTULB4MR.js → witness-chain-BLZ4ZKAD.js} +2 -2
  254. package/dist/cli/chunks/witness-chain-GNNF23XU.js +2 -0
  255. package/dist/cli/chunks/{workflow-TEBAAHNR.js → workflow-RNSDKRZ4.js} +4 -4
  256. package/dist/cli/chunks/workflow-orchestrator-S2YONHGM.js +2 -0
  257. package/dist/cli/chunks/{wrappers-DVMVRKXK.js → wrappers-J7RXMIOY.js} +2 -2
  258. package/dist/cli/commands/hooks-handlers/editing-hooks.js +9 -3
  259. package/dist/cli/commands/hooks-handlers/hooks-dream-learning.js +16 -24
  260. package/dist/cli/commands/hooks-handlers/hooks-shared.d.ts +1 -1
  261. package/dist/cli/commands/hooks-handlers/hooks-shared.js +8 -1
  262. package/dist/cli/commands/hooks-handlers/routing-hooks.js +15 -3
  263. package/dist/cli/commands/hooks-handlers/task-hooks.js +37 -46
  264. package/dist/cli/commands/learning.js +194 -0
  265. package/dist/domains/learning-optimization/services/learning-coordinator.js +37 -17
  266. package/dist/init/phases/10-workers.js +20 -1
  267. package/dist/kernel/hybrid-backend.d.ts +17 -7
  268. package/dist/kernel/hybrid-backend.js +24 -10
  269. package/dist/kernel/interfaces.d.ts +33 -6
  270. package/dist/kernel/kernel.d.ts +1 -0
  271. package/dist/kernel/kernel.js +57 -0
  272. package/dist/kernel/memory-backend.d.ts +5 -5
  273. package/dist/kernel/memory-backend.js +14 -7
  274. package/dist/kernel/unified-memory-schemas.d.ts +1 -1
  275. package/dist/kernel/unified-memory-schemas.js +7 -1
  276. package/dist/learning/agent-routing.d.ts +134 -1
  277. package/dist/learning/agent-routing.js +185 -2
  278. package/dist/learning/dream/dream-insights-pruner.d.ts +49 -0
  279. package/dist/learning/dream/dream-insights-pruner.js +53 -0
  280. package/dist/learning/dream/dream-scheduler.js +17 -0
  281. package/dist/learning/loop-health.d.ts +84 -0
  282. package/dist/learning/loop-health.js +91 -0
  283. package/dist/learning/pattern-usage-recorder.d.ts +58 -0
  284. package/dist/learning/pattern-usage-recorder.js +72 -0
  285. package/dist/learning/qe-reasoning-bank-types.d.ts +11 -0
  286. package/dist/learning/qe-reasoning-bank.d.ts +11 -0
  287. package/dist/learning/qe-reasoning-bank.js +86 -3
  288. package/dist/learning/routing-topology-gate.d.ts +40 -0
  289. package/dist/learning/routing-topology-gate.js +55 -0
  290. package/dist/learning/sqlite-persistence.d.ts +6 -1
  291. package/dist/learning/sqlite-persistence.js +14 -20
  292. package/dist/mcp/bundle.js +3837 -3811
  293. package/dist/mcp/handlers/core-handlers.js +21 -0
  294. package/dist/routing/routing-feedback.js +7 -3
  295. package/dist/routing/routing-outcomes-migration.d.ts +31 -0
  296. package/dist/routing/routing-outcomes-migration.js +60 -0
  297. package/dist/workers/interfaces.d.ts +26 -0
  298. package/dist/workers/worker-manager.d.ts +15 -12
  299. package/dist/workers/worker-manager.js +11 -0
  300. package/dist/workers/workers/learning-consolidation.d.ts +28 -0
  301. package/dist/workers/workers/learning-consolidation.js +302 -71
  302. package/package.json +3 -1
  303. package/dist/cli/chunks/adapter-HV42JOZD.js +0 -2
  304. package/dist/cli/chunks/aqe-learning-engine-GL22PE2V.js +0 -2
  305. package/dist/cli/chunks/base-4KQ2FGUX.js +0 -2
  306. package/dist/cli/chunks/browser-workflow-CTE7BDM4.js +0 -2
  307. package/dist/cli/chunks/chunk-3NGNSKL3.js +0 -14
  308. package/dist/cli/chunks/chunk-6HSFZ6SL.js +0 -180
  309. package/dist/cli/chunks/chunk-7Z3GBQNV.js +0 -2
  310. package/dist/cli/chunks/chunk-AQJ6XS34.js +0 -2
  311. package/dist/cli/chunks/chunk-H2IMXQCJ.js +0 -2
  312. package/dist/cli/chunks/chunk-SPCANEJY.js +0 -95
  313. package/dist/cli/chunks/client-FRVNMXQO.js +0 -2
  314. package/dist/cli/chunks/cross-domain-router-BVCPAWG2.js +0 -2
  315. package/dist/cli/chunks/daemon-PHIZPZIE.js +0 -19
  316. package/dist/cli/chunks/dream-77ODIFIF.js +0 -2
  317. package/dist/cli/chunks/hnsw-adapter-CQGQS3V7.js +0 -2
  318. package/dist/cli/chunks/hnsw-index-2ACF6FOJ.js +0 -2
  319. package/dist/cli/chunks/hooks-YROFO6PE.js +0 -259
  320. package/dist/cli/chunks/impact-analyzer-LWEGK23B.js +0 -2
  321. package/dist/cli/chunks/init-wizard-7BS3QMWR.js +0 -2
  322. package/dist/cli/chunks/kernel-TX67WXSI.js +0 -2
  323. package/dist/cli/chunks/knowledge-graph-TDSP2UE2.js +0 -2
  324. package/dist/cli/chunks/learning-RRWV3SEL.js +0 -107
  325. package/dist/cli/chunks/load-test-GEBBBUMV.js +0 -2
  326. package/dist/cli/chunks/memory-backend-WQS2MLW2.js +0 -2
  327. package/dist/cli/chunks/memory-handlers-RTY5MBA5.js +0 -2
  328. package/dist/cli/chunks/protocol-executor-DT7XHMLL.js +0 -2
  329. package/dist/cli/chunks/qe-reasoning-bank-LDNETZVA.js +0 -2
  330. package/dist/cli/chunks/queen-coordinator-AF7HCQSM.js +0 -2
  331. package/dist/cli/chunks/router-OWQ5EI72.js +0 -2
  332. package/dist/cli/chunks/routing-feedback-B43DEQMK.js +0 -2
  333. package/dist/cli/chunks/rvf-native-adapter-XBJDXHNI.js +0 -2
  334. package/dist/cli/chunks/safe-db-RT3LEDUG.js +0 -2
  335. package/dist/cli/chunks/schedule-EHUDCKS2.js +0 -2
  336. package/dist/cli/chunks/scheduler-GEGZ4J3C.js +0 -2
  337. package/dist/cli/chunks/shared-rvf-adapter-LNBUNRAM.js +0 -2
  338. package/dist/cli/chunks/sqlite-persistence-3DGRJH3K.js +0 -2
  339. package/dist/cli/chunks/sync-5CDYOT3H.js +0 -23
  340. package/dist/cli/chunks/unified-memory-ZSBX4LYU.js +0 -2
  341. package/dist/cli/chunks/unified-memory-hnsw-Y6EKAMRP.js +0 -2
  342. package/dist/cli/chunks/unified-persistence-2PDVU2U5.js +0 -2
  343. package/dist/cli/chunks/visual-security-RHMFLKVQ.js +0 -2
  344. package/dist/cli/chunks/witness-chain-QO237QOF.js +0 -2
  345. package/dist/cli/chunks/workflow-orchestrator-RHM5MIGE.js +0 -2
@@ -65,6 +65,7 @@ Examples:
65
65
  registerDreamCommand(learning);
66
66
  registerRepairCommand(learning);
67
67
  registerHealthCommand(learning);
68
+ registerLoopHealthCommand(learning);
68
69
  return learning;
69
70
  }
70
71
  // ============================================================================
@@ -1414,6 +1415,199 @@ function registerHealthCommand(learning) {
1414
1415
  });
1415
1416
  }
1416
1417
  // ============================================================================
1418
+ // Subcommand: loop-health (#488 B.2)
1419
+ // ============================================================================
1420
+ /**
1421
+ * Component staleness thresholds (ms). Each component has its own expected
1422
+ * cadence — the bridge polls every 5s, the learning worker ticks every 30
1423
+ * min, the dream scheduler is variable. Anything older than ~2x its cadence
1424
+ * counts as stale and operators should investigate.
1425
+ */
1426
+ const COMPONENT_STALE_THRESHOLDS = {
1427
+ bridge: 30_000, // 5s poll → stale at 30s
1428
+ learningWorker: 2 * 3600_000, // 30 min tick → stale at 2h
1429
+ dreamScheduler: 2 * 3600_000, // similar cadence to worker
1430
+ };
1431
+ function registerLoopHealthCommand(learning) {
1432
+ learning
1433
+ .command('loop-health')
1434
+ .description('Show pipeline component liveness for the self-learning loop')
1435
+ .option('--json', 'Output as JSON')
1436
+ .action(async (options) => {
1437
+ try {
1438
+ const projectRoot = findProjectRoot();
1439
+ const dbPath = path.join(projectRoot, '.agentic-qe', 'memory.db');
1440
+ if (!existsSync(dbPath)) {
1441
+ throw new Error('Database not found. Run "aqe init --auto" first.');
1442
+ }
1443
+ const db = openDatabase(dbPath, { readonly: true });
1444
+ let raw;
1445
+ try {
1446
+ // Try the unified kv_store first (kernel-owned key).
1447
+ const row = db
1448
+ .prepare(`SELECT value FROM kv_store WHERE key = 'learning:loop-health' LIMIT 1`)
1449
+ .get();
1450
+ raw = row?.value;
1451
+ }
1452
+ catch {
1453
+ // kv_store may not exist yet on a freshly-init'd shop.
1454
+ }
1455
+ // ADR-095: routing diversification stats (7-day rolling window)
1456
+ let routingStats = null;
1457
+ try {
1458
+ const colCheck = db
1459
+ .prepare("PRAGMA table_info(routing_outcomes)")
1460
+ .all();
1461
+ const hasExploration = colCheck.some((c) => c.name === 'exploration');
1462
+ if (hasExploration) {
1463
+ const totals = db
1464
+ .prepare(`SELECT
1465
+ COUNT(*) AS total,
1466
+ SUM(CASE WHEN exploration = 1 THEN 1 ELSE 0 END) AS explore,
1467
+ AVG(criticality) AS avgCrit,
1468
+ AVG(q_weight) AS avgQ
1469
+ FROM routing_outcomes
1470
+ WHERE created_at >= datetime('now', '-7 days')`)
1471
+ .get();
1472
+ const total = totals.total ?? 0;
1473
+ const explore = totals.explore ?? 0;
1474
+ const exploit = total - explore;
1475
+ const exploitQ = db
1476
+ .prepare(`SELECT AVG(quality_score) AS avgQ FROM routing_outcomes
1477
+ WHERE exploration = 0 AND quality_score >= 0
1478
+ AND created_at >= datetime('now', '-7 days')`)
1479
+ .get();
1480
+ const exploreQ = db
1481
+ .prepare(`SELECT AVG(quality_score) AS avgQ FROM routing_outcomes
1482
+ WHERE exploration = 1 AND quality_score >= 0
1483
+ AND created_at >= datetime('now', '-7 days')`)
1484
+ .get();
1485
+ routingStats = {
1486
+ totalDecisions: total,
1487
+ explorationCount: explore,
1488
+ exploitCount: exploit,
1489
+ explorationRate: total > 0 ? explore / total : 0,
1490
+ avgQualityExploit: exploitQ.avgQ,
1491
+ avgQualityExplore: exploreQ.avgQ,
1492
+ avgCriticality: totals.avgCrit,
1493
+ avgQWeight: totals.avgQ,
1494
+ };
1495
+ }
1496
+ }
1497
+ catch {
1498
+ // routing_outcomes missing or pre-ADR-095 schema — skip silently.
1499
+ }
1500
+ db.close();
1501
+ let health = null;
1502
+ if (raw) {
1503
+ try {
1504
+ health = safeJsonParse(raw);
1505
+ }
1506
+ catch {
1507
+ health = null;
1508
+ }
1509
+ }
1510
+ const now = Date.now();
1511
+ const verdict = (componentKey, c) => {
1512
+ const threshold = COMPONENT_STALE_THRESHOLDS[componentKey] ?? 600_000;
1513
+ if (!c || !c.lastSuccessAt)
1514
+ return 'never-ran';
1515
+ const age = now - new Date(c.lastSuccessAt).getTime();
1516
+ return age > threshold ? 'stale' : 'live';
1517
+ };
1518
+ if (options.json) {
1519
+ if (!health) {
1520
+ printJson({
1521
+ overallLastSuccess: null,
1522
+ bootedAt: null,
1523
+ components: {},
1524
+ verdicts: {},
1525
+ routingDiversification: routingStats,
1526
+ note: 'No loop-health record yet. Workers must run at least once for this to populate.',
1527
+ });
1528
+ return;
1529
+ }
1530
+ const verdicts = {};
1531
+ for (const key of Object.keys(health.components)) {
1532
+ verdicts[key] = verdict(key, health.components[key]);
1533
+ }
1534
+ printJson({ ...health, verdicts, routingDiversification: routingStats });
1535
+ return;
1536
+ }
1537
+ console.log('');
1538
+ console.log(chalk.bold('Self-Learning Loop Health'));
1539
+ console.log('');
1540
+ if (!health) {
1541
+ console.log(chalk.dim(' No loop-health record yet.'));
1542
+ console.log(chalk.dim(' Workers must run at least once to populate.'));
1543
+ console.log(chalk.dim(' Start the daemon: aqe daemon start'));
1544
+ // FALL THROUGH (no early return): routing-diversification stats may
1545
+ // still be available even when loop-health components haven't ticked
1546
+ // yet (e.g., routing happened via hook handlers but daemon-side
1547
+ // workers never ran). Operators need both signals visible.
1548
+ }
1549
+ else {
1550
+ console.log(` Booted at: ${chalk.dim(health.bootedAt)}`);
1551
+ console.log(` Last success (any): ${health.overallLastSuccess || chalk.dim('(none yet)')}`);
1552
+ console.log('');
1553
+ console.log(chalk.bold(' Components:'));
1554
+ const known = [
1555
+ ['bridge', 'CapturedExperienceBridge'],
1556
+ ['learningWorker', 'LearningConsolidationWorker'],
1557
+ ['dreamScheduler', 'DreamScheduler'],
1558
+ ];
1559
+ for (const [key, label] of known) {
1560
+ const c = health.components[key];
1561
+ const v = verdict(key, c);
1562
+ const colored = v === 'live'
1563
+ ? chalk.green('● live')
1564
+ : v === 'stale'
1565
+ ? chalk.yellow('● stale')
1566
+ : chalk.dim('○ never-ran');
1567
+ const lastSuccess = c?.lastSuccessAt || chalk.dim('(never)');
1568
+ const ticks = c
1569
+ ? `${c.successesSinceBoot}/${c.ticksSinceBoot} ticks ok`
1570
+ : chalk.dim('no ticks');
1571
+ console.log(` ${label.padEnd(32)} ${colored.padEnd(20)} ${ticks}`);
1572
+ console.log(` ${chalk.dim('last success:')} ${lastSuccess}`);
1573
+ if (c?.lastError) {
1574
+ console.log(` ${chalk.red('last error:')} ${c.lastError.message} ${chalk.dim('(at ' + c.lastError.at + ')')}`);
1575
+ }
1576
+ }
1577
+ const stale = known.filter(([k, _]) => verdict(k, health.components[k]) === 'stale');
1578
+ if (stale.length > 0) {
1579
+ console.log('');
1580
+ console.log(chalk.yellow(` Warning: ${stale.length} component(s) stale — daemon may not be running or the loop is wedged.`));
1581
+ }
1582
+ }
1583
+ // ADR-095: routing diversification dashboard
1584
+ if (routingStats && routingStats.totalDecisions > 0) {
1585
+ console.log('');
1586
+ console.log(chalk.bold(' Routing diversification (last 7 days):'));
1587
+ const ratePct = (routingStats.explorationRate * 100).toFixed(1);
1588
+ console.log(` Decisions: ${routingStats.totalDecisions} (${routingStats.exploitCount} exploit, ${routingStats.explorationCount} explore = ${ratePct}%)`);
1589
+ if (routingStats.avgQualityExploit !== null && routingStats.avgQualityExplore !== null) {
1590
+ const delta = routingStats.avgQualityExplore - routingStats.avgQualityExploit;
1591
+ const deltaStr = delta >= 0 ? chalk.green(`+${delta.toFixed(3)}`) : chalk.red(delta.toFixed(3));
1592
+ console.log(` Avg quality: exploit=${routingStats.avgQualityExploit.toFixed(3)}, explore=${routingStats.avgQualityExplore.toFixed(3)} (Δ ${deltaStr})`);
1593
+ }
1594
+ if (routingStats.avgCriticality !== null) {
1595
+ console.log(` Avg mincut multiplier: ${routingStats.avgCriticality.toFixed(2)} (1.0=full rate, 0.2=critical-topology dampening)`);
1596
+ }
1597
+ if (routingStats.avgQWeight !== null && routingStats.avgQWeight > 0) {
1598
+ console.log(` Avg Q-weight: ${routingStats.avgQWeight.toFixed(3)} (0=cold start, ${0.4} max)`);
1599
+ }
1600
+ }
1601
+ console.log('');
1602
+ return;
1603
+ }
1604
+ catch (error) {
1605
+ printError(`loop-health failed: ${error instanceof Error ? error.message : 'unknown'}`);
1606
+ throw error;
1607
+ }
1608
+ });
1609
+ }
1610
+ // ============================================================================
1417
1611
  // Exports
1418
1612
  // ============================================================================
1419
1613
  export { initializeLearningSystem } from './learning-helpers.js';
@@ -22,6 +22,14 @@ const DEFAULT_CONFIG = {
22
22
  * Implements pattern learning and experience mining capabilities
23
23
  */
24
24
  const logger = LoggerFactory.create('learning-optimization/learning-coordinator');
25
+ /**
26
+ * #491 Bug 2: every read in this file must pass this namespace to match
27
+ * the writes (which already specify `namespace: 'learning-optimization'`).
28
+ * Without it, HybridBackend defaults to `default` and the coordinator
29
+ * cannot read its own data — `mineExperiences` returned 0 for every
30
+ * domain even on installs with hundreds of indexed experiences.
31
+ */
32
+ const LEARNING_NS = { namespace: 'learning-optimization' };
25
33
  export class LearningCoordinatorService {
26
34
  config;
27
35
  memory;
@@ -245,9 +253,9 @@ Provide:
245
253
  async findMatchingPatterns(context, limit = 10) {
246
254
  try {
247
255
  const patterns = [];
248
- const keys = await this.memory.search('learning:pattern:*', 100);
256
+ const keys = await this.memory.search('learning:pattern:*', 100, LEARNING_NS);
249
257
  for (const key of keys) {
250
- const pattern = await this.memory.get(key);
258
+ const pattern = await this.memory.get(key, LEARNING_NS);
251
259
  if (pattern && this.matchesContext(pattern, context)) {
252
260
  patterns.push(pattern);
253
261
  }
@@ -292,7 +300,7 @@ Provide:
292
300
  async updatePatternFeedback(patternId, success) {
293
301
  try {
294
302
  const key = `learning:pattern:${patternId}`;
295
- const pattern = await this.memory.get(key);
303
+ const pattern = await this.memory.get(key, LEARNING_NS);
296
304
  if (!pattern) {
297
305
  return err(new Error(`Pattern ${patternId} not found`));
298
306
  }
@@ -329,7 +337,7 @@ Provide:
329
337
  }
330
338
  const patterns = [];
331
339
  for (const id of patternIds) {
332
- const pattern = await this.memory.get(`learning:pattern:${id}`);
340
+ const pattern = await this.memory.get(`learning:pattern:${id}`, LEARNING_NS);
333
341
  if (pattern) {
334
342
  patterns.push(pattern);
335
343
  }
@@ -377,10 +385,10 @@ Provide:
377
385
  */
378
386
  async getPatternStats(domain) {
379
387
  try {
380
- const keys = await this.memory.search('learning:pattern:*', 500);
388
+ const keys = await this.memory.search('learning:pattern:*', 500, LEARNING_NS);
381
389
  const patterns = [];
382
390
  for (const key of keys) {
383
- const pattern = await this.memory.get(key);
391
+ const pattern = await this.memory.get(key, LEARNING_NS);
384
392
  if (pattern && (!domain || pattern.domain === domain)) {
385
393
  patterns.push(pattern);
386
394
  }
@@ -525,12 +533,12 @@ Provide:
525
533
  */
526
534
  async getReplayBuffer(agentId, limit = 100) {
527
535
  try {
528
- const keys = await this.memory.search(`learning:experience:index:agent:${agentId.value}:*`, limit);
536
+ const keys = await this.memory.search(`learning:experience:index:agent:${agentId.value}:*`, limit, LEARNING_NS);
529
537
  const experiences = [];
530
538
  for (const key of keys) {
531
- const experienceId = await this.memory.get(key);
539
+ const experienceId = await this.memory.get(key, LEARNING_NS);
532
540
  if (experienceId) {
533
- const experience = await this.memory.get(`learning:experience:${experienceId}`);
541
+ const experience = await this.memory.get(`learning:experience:${experienceId}`, LEARNING_NS);
534
542
  if (experience) {
535
543
  experiences.push(experience);
536
544
  }
@@ -601,18 +609,18 @@ Provide:
601
609
  }
602
610
  async archivePattern(patternId) {
603
611
  const key = `learning:pattern:${patternId}`;
604
- const pattern = await this.memory.get(key);
612
+ const pattern = await this.memory.get(key, LEARNING_NS);
605
613
  if (pattern) {
606
614
  await this.memory.set(`learning:pattern:archived:${patternId}`, pattern, {
607
615
  namespace: 'learning-optimization',
608
616
  persist: true,
609
617
  });
610
- await this.memory.delete(key);
618
+ await this.memory.delete(key, LEARNING_NS);
611
619
  }
612
620
  }
613
621
  async updatePatternUsage(patternId) {
614
622
  const key = `learning:pattern:${patternId}`;
615
- const pattern = await this.memory.get(key);
623
+ const pattern = await this.memory.get(key, LEARNING_NS);
616
624
  if (pattern) {
617
625
  const updated = {
618
626
  ...pattern,
@@ -639,14 +647,26 @@ Provide:
639
647
  await this.memory.set(`learning:experience:index:domain:${experience.domain}:${experience.id}`, experience.id, { namespace: 'learning-optimization', ttl: 86400 * 30 });
640
648
  }
641
649
  async getExperiencesByDomainAndTime(domain, timeRange) {
642
- const keys = await this.memory.search(`learning:experience:index:domain:${domain}:*`, 1000);
650
+ const keys = await this.memory.search(`learning:experience:index:domain:${domain}:*`, 1000, LEARNING_NS);
643
651
  const experiences = [];
644
652
  for (const key of keys) {
645
- const experienceId = await this.memory.get(key);
653
+ const experienceId = await this.memory.get(key, LEARNING_NS);
646
654
  if (experienceId) {
647
- const experience = await this.memory.get(`learning:experience:${experienceId}`);
648
- if (experience && timeRange.contains(experience.timestamp)) {
649
- experiences.push(experience);
655
+ const experience = await this.memory.get(`learning:experience:${experienceId}`, LEARNING_NS);
656
+ if (experience) {
657
+ // #491 Bug 3: kv stores Date via JSON.stringify (→ ISO string)
658
+ // but JSON.parse does not re-hydrate. `TimeRange.contains` does
659
+ // `date >= start`; in `string >= Date`, the string coerces to
660
+ // NaN and every comparison is false — so every experience was
661
+ // silently dropped by the time-window filter, leaving
662
+ // `mineExperiences` mining 0 for every domain. Coerce at the
663
+ // boundary; downstream code expects a real Date.
664
+ const ts = experience.timestamp instanceof Date
665
+ ? experience.timestamp
666
+ : new Date(experience.timestamp);
667
+ if (timeRange.contains(ts)) {
668
+ experiences.push({ ...experience, timestamp: ts });
669
+ }
650
670
  }
651
671
  }
652
672
  }
@@ -121,12 +121,30 @@ if (existsSync(pidFile)) {
121
121
  const ts = new Date().toISOString();
122
122
  appendFileSync(logFile, '[' + ts + '] Starting AQE v3 Worker Daemon...\\n');
123
123
 
124
- // Find the best way to run aqe-mcp
124
+ // Find the best way to run aqe-mcp.
125
+ //
126
+ // #488 B.1: candidate ordering matters for the pidfile contract. When we
127
+ // spawn the real MCP binary directly, child.pid is the long-lived process
128
+ // — \`process.kill(pid, 0)\` against the pidfile correctly reports liveness.
129
+ // When we fall back to \`npx --yes agentic-qe mcp\`, child.pid is the npx
130
+ // wrapper PID, which exits as soon as it has forked the real bundle. The
131
+ // pidfile then points at a dead process and idempotency checks misbehave.
132
+ //
133
+ // We try in order: local .bin → local node_modules bundle → global install
134
+ // via require.resolve → npx wrapper (last resort, with the caveat above).
125
135
  const candidates = [
126
136
  join(projectRoot, 'node_modules', '.bin', 'aqe-mcp'),
127
137
  join(projectRoot, 'node_modules', 'agentic-qe', 'dist', 'mcp', 'bundle.js'),
128
138
  ];
129
139
 
140
+ // Probe globally-installed agentic-qe (npm install -g) via require.resolve.
141
+ // This is the case the npx fallback used to silently cover with a bad PID.
142
+ try {
143
+ candidates.push(require.resolve('agentic-qe/dist/mcp/bundle.js'));
144
+ } catch {
145
+ // Not globally installed — fall through to npx fallback below.
146
+ }
147
+
130
148
  let mcpCmd, mcpArgs;
131
149
  const binCandidate = candidates.find(c => existsSync(c));
132
150
 
@@ -139,6 +157,7 @@ if (binCandidate && binCandidate.endsWith('bundle.js')) {
139
157
  } else {
140
158
  mcpCmd = process.platform === 'win32' ? 'npx.cmd' : 'npx';
141
159
  mcpArgs = ['--yes', 'agentic-qe', 'mcp'];
160
+ appendFileSync(logFile, '[' + ts + '] WARNING: using npx fallback — daemon.pid will point at the npx wrapper, not the MCP server. \`aqe daemon status\` may misreport liveness after the wrapper exits.\\n');
142
161
  }
143
162
 
144
163
  appendFileSync(logFile, '[' + ts + '] Using: ' + mcpCmd + ' ' + mcpArgs.join(' ') + '\\n');
@@ -9,7 +9,7 @@
9
9
  * This is a facade over UnifiedMemoryManager that maintains
10
10
  * backward compatibility with existing MemoryBackend interface.
11
11
  */
12
- import { MemoryBackend, StoreOptions, VectorSearchResult } from './interfaces';
12
+ import { MemoryBackend, StoreOptions, RetrieveOptions, VectorSearchResult } from './interfaces';
13
13
  import { UnifiedMemoryManager } from './unified-memory';
14
14
  /**
15
15
  * SQLite connection configuration (legacy - kept for API compatibility)
@@ -83,21 +83,31 @@ export declare class HybridMemoryBackend implements MemoryBackend {
83
83
  */
84
84
  set<T>(key: string, value: T, options?: StoreOptions): Promise<void>;
85
85
  /**
86
- * Retrieve a value
86
+ * Retrieve a value.
87
+ *
88
+ * #491 Bug 2: previously this method hard-coded `defaultNamespace`, so
89
+ * any caller that wrote with `set(k, v, {namespace:'foo'})` could not
90
+ * read its own data back. The whole LearningCoordinator read path
91
+ * (`getExperiencesByDomainAndTime` etc.) was broken by this — writes
92
+ * landed in `learning-optimization`, reads queried `default`, and
93
+ * `mineExperiences` mined 0 for every domain even on installs with
94
+ * hundreds of indexed experiences. Honor the namespace; default
95
+ * preserves the historical behavior for the many call sites that
96
+ * still pass no option.
87
97
  */
88
- get<T>(key: string): Promise<T | undefined>;
98
+ get<T>(key: string, options?: RetrieveOptions): Promise<T | undefined>;
89
99
  /**
90
100
  * Delete a value
91
101
  */
92
- delete(key: string): Promise<boolean>;
102
+ delete(key: string, options?: RetrieveOptions): Promise<boolean>;
93
103
  /**
94
104
  * Check if key exists
95
105
  */
96
- has(key: string): Promise<boolean>;
106
+ has(key: string, options?: RetrieveOptions): Promise<boolean>;
97
107
  /**
98
- * Search for keys matching pattern
108
+ * Search for keys matching pattern. See `get` for the namespace rationale.
99
109
  */
100
- search(pattern: string, limit?: number): Promise<string[]>;
110
+ search(pattern: string, limit?: number, options?: RetrieveOptions): Promise<string[]>;
101
111
  /**
102
112
  * Vector similarity search
103
113
  * Now uses unified memory's persistent vector storage
@@ -92,19 +92,31 @@ export class HybridMemoryBackend {
92
92
  await this.unifiedMemory.kvSet(key, value, namespace, options?.ttl);
93
93
  }
94
94
  /**
95
- * Retrieve a value
95
+ * Retrieve a value.
96
+ *
97
+ * #491 Bug 2: previously this method hard-coded `defaultNamespace`, so
98
+ * any caller that wrote with `set(k, v, {namespace:'foo'})` could not
99
+ * read its own data back. The whole LearningCoordinator read path
100
+ * (`getExperiencesByDomainAndTime` etc.) was broken by this — writes
101
+ * landed in `learning-optimization`, reads queried `default`, and
102
+ * `mineExperiences` mined 0 for every domain even on installs with
103
+ * hundreds of indexed experiences. Honor the namespace; default
104
+ * preserves the historical behavior for the many call sites that
105
+ * still pass no option.
96
106
  */
97
- async get(key) {
107
+ async get(key, options) {
98
108
  this.ensureInitialized();
99
- return this.unifiedMemory.kvGet(key, this.config.defaultNamespace);
109
+ const namespace = options?.namespace ?? this.config.defaultNamespace;
110
+ return this.unifiedMemory.kvGet(key, namespace);
100
111
  }
101
112
  /**
102
113
  * Delete a value
103
114
  */
104
- async delete(key) {
115
+ async delete(key, options) {
105
116
  this.ensureInitialized();
117
+ const namespace = options?.namespace ?? this.config.defaultNamespace;
106
118
  // Delete from KV store
107
- const kvDeleted = await this.unifiedMemory.kvDelete(key, this.config.defaultNamespace);
119
+ const kvDeleted = await this.unifiedMemory.kvDelete(key, namespace);
108
120
  // Also try to delete from vectors (in case it's a vector key)
109
121
  const vectorDeleted = await this.unifiedMemory.vectorDelete(key);
110
122
  return kvDeleted || vectorDeleted;
@@ -112,16 +124,18 @@ export class HybridMemoryBackend {
112
124
  /**
113
125
  * Check if key exists
114
126
  */
115
- async has(key) {
127
+ async has(key, options) {
116
128
  this.ensureInitialized();
117
- return this.unifiedMemory.kvExists(key, this.config.defaultNamespace);
129
+ const namespace = options?.namespace ?? this.config.defaultNamespace;
130
+ return this.unifiedMemory.kvExists(key, namespace);
118
131
  }
119
132
  /**
120
- * Search for keys matching pattern
133
+ * Search for keys matching pattern. See `get` for the namespace rationale.
121
134
  */
122
- async search(pattern, limit = 100) {
135
+ async search(pattern, limit = 100, options) {
123
136
  this.ensureInitialized();
124
- return this.unifiedMemory.kvSearch(pattern, this.config.defaultNamespace, limit);
137
+ const namespace = options?.namespace ?? this.config.defaultNamespace;
138
+ return this.unifiedMemory.kvSearch(pattern, namespace, limit);
125
139
  }
126
140
  /**
127
141
  * Vector similarity search
@@ -200,14 +200,21 @@ export interface PluginLoader {
200
200
  export interface MemoryBackend extends Initializable, Disposable {
201
201
  /** Store a value */
202
202
  set<T>(key: string, value: T, options?: StoreOptions): Promise<void>;
203
- /** Retrieve a value */
204
- get<T>(key: string): Promise<T | undefined>;
203
+ /**
204
+ * Retrieve a value.
205
+ *
206
+ * `options.namespace` lets callers read from a non-default namespace.
207
+ * Without this, a caller that wrote with `set(k, v, {namespace:'foo'})`
208
+ * could not read its own data back — `get` would silently fall through
209
+ * to the default namespace and return undefined (issue #491 Bug 2).
210
+ */
211
+ get<T>(key: string, options?: RetrieveOptions): Promise<T | undefined>;
205
212
  /** Delete a value */
206
- delete(key: string): Promise<boolean>;
213
+ delete(key: string, options?: RetrieveOptions): Promise<boolean>;
207
214
  /** Check if key exists */
208
- has(key: string): Promise<boolean>;
209
- /** Search by pattern */
210
- search(pattern: string, limit?: number): Promise<string[]>;
215
+ has(key: string, options?: RetrieveOptions): Promise<boolean>;
216
+ /** Search by pattern (`options.namespace` mirrors `get`). */
217
+ search(pattern: string, limit?: number, options?: RetrieveOptions): Promise<string[]>;
211
218
  /** Vector similarity search (HNSW) */
212
219
  vectorSearch(embedding: number[], k: number): Promise<VectorSearchResult[]>;
213
220
  /** Store vector embedding */
@@ -230,6 +237,14 @@ export interface StoreOptions {
230
237
  namespace?: string;
231
238
  persist?: boolean;
232
239
  }
240
+ /**
241
+ * Options for memory read operations. Symmetric with `StoreOptions.namespace`
242
+ * so a caller can read back exactly what it wrote into a non-default
243
+ * namespace (issue #491 Bug 2).
244
+ */
245
+ export interface RetrieveOptions {
246
+ namespace?: string;
247
+ }
233
248
  export interface VectorSearchResult {
234
249
  key: string;
235
250
  score: number;
@@ -297,6 +312,18 @@ export interface KernelConfig {
297
312
  * can set false to skip the plugin-load cost.
298
313
  */
299
314
  enableExperienceBridge?: boolean;
315
+ /**
316
+ * Whether to start the DreamScheduler during initialize() (ADR-094).
317
+ * When true (default), dream cycles run inside the long-lived kernel
318
+ * process instead of hook subprocesses. Hook subprocesses keep only
319
+ * `incrementDreamExperience` — the kernel-side scheduler is the
320
+ * authoritative trigger.
321
+ *
322
+ * Long-lived processes (MCP server, daemon) want this true.
323
+ * Short-lived CLI commands that complete in <1s can set false to skip
324
+ * DreamEngine init cost.
325
+ */
326
+ enableDreamScheduler?: boolean;
300
327
  }
301
328
  /**
302
329
  * Event middleware interface for anti-drift and other event processing (ADR-060)
@@ -21,6 +21,7 @@ export declare class QEKernelImpl implements QEKernel {
21
21
  private _initialized;
22
22
  private _loopTracker;
23
23
  private _experienceBridge?;
24
+ private _dreamScheduler?;
24
25
  constructor(config?: Partial<KernelConfig>);
25
26
  get eventBus(): EventBus;
26
27
  get coordinator(): AgentCoordinator;
@@ -19,6 +19,8 @@ import * as fs from 'fs';
19
19
  import { PluginLifecycleManager } from '../plugins/lifecycle';
20
20
  import { PluginCache } from '../plugins/cache';
21
21
  import { CapturedExperienceBridge } from '../bridge/captured-experience-bridge.js';
22
+ import { DreamScheduler } from '../learning/dream/dream-scheduler.js';
23
+ import { createDreamEngine } from '../learning/dream/dream-engine.js';
22
24
  // Import domain plugin factories
23
25
  import { createTestGenerationPlugin } from '../domains/test-generation/plugin';
24
26
  import { createTestExecutionPlugin } from '../domains/test-execution/plugin';
@@ -69,6 +71,10 @@ const DEFAULT_CONFIG = {
69
71
  // working out of the box. CLI commands that don't need event-driven
70
72
  // domain reactions opt out by passing `enableExperienceBridge: false`.
71
73
  enableExperienceBridge: true,
74
+ // ADR-094: kernel-side dream cycles. Defaults match the bridge — long-lived
75
+ // processes start the scheduler so dream cycles run in the kernel rather
76
+ // than inside hook subprocesses. Short-lived CLIs opt out.
77
+ enableDreamScheduler: true,
72
78
  };
73
79
  export class QEKernelImpl {
74
80
  _eventBus;
@@ -83,6 +89,10 @@ export class QEKernelImpl {
83
89
  // Issue #479: drains captured_experiences into the eventBus so hook-driven
84
90
  // activity reaches the 13 domain plugins' subscribeToEvents() handlers.
85
91
  _experienceBridge;
92
+ // ADR-094: kernel-side dream cycles. Replaces the in-hook
93
+ // checkAndTriggerDream path so 10-second SQLite write transactions move
94
+ // out of short-lived hook subprocesses into the long-lived kernel.
95
+ _dreamScheduler;
86
96
  constructor(config = {}) {
87
97
  this._config = { ...DEFAULT_CONFIG, ...config };
88
98
  this._startTime = new Date();
@@ -262,9 +272,56 @@ export class QEKernelImpl {
262
272
  this._experienceBridge = undefined;
263
273
  }
264
274
  }
275
+ // ADR-094: Start the kernel-side DreamScheduler so dream cycles run in
276
+ // the long-lived process. Hook subprocesses no longer trigger dreams —
277
+ // they only bump the experience counter (incrementDreamExperience).
278
+ // The scheduler subscribes to its own event triggers (quality-gate
279
+ // failure, domain milestones) and runs time-based dreams on its own
280
+ // cadence (default 1h). DreamEngine.ensureConceptsLoaded() auto-loads
281
+ // patterns from qe_patterns, so no separate ReasoningBank is needed here.
282
+ if (this._config.enableDreamScheduler !== false) {
283
+ try {
284
+ const dreamEngine = createDreamEngine({
285
+ maxDurationMs: 10_000,
286
+ minConceptsRequired: 3,
287
+ });
288
+ await dreamEngine.initialize();
289
+ this._dreamScheduler = new DreamScheduler({
290
+ dreamEngine,
291
+ eventBus: this._eventBus,
292
+ memoryBackend: this._memory,
293
+ });
294
+ await this._dreamScheduler.initialize();
295
+ this._dreamScheduler.start();
296
+ }
297
+ catch (err) {
298
+ console.warn('[QEKernel] DreamScheduler failed to start:', err instanceof Error ? err.message : err);
299
+ // Tear down anything we partially constructed so we don't leak a
300
+ // half-initialized scheduler (e.g., engine init succeeded but
301
+ // scheduler.start threw).
302
+ if (this._dreamScheduler) {
303
+ try {
304
+ await this._dreamScheduler.dispose();
305
+ }
306
+ catch { /* swallow during cleanup */ }
307
+ }
308
+ this._dreamScheduler = undefined;
309
+ }
310
+ }
265
311
  this._initialized = true;
266
312
  }
267
313
  async dispose() {
314
+ // ADR-094: Stop the dream scheduler first so a dream-in-progress doesn't
315
+ // try to write to a disposed memory backend.
316
+ if (this._dreamScheduler) {
317
+ try {
318
+ await this._dreamScheduler.dispose();
319
+ }
320
+ catch (err) {
321
+ console.warn('[QEKernel] DreamScheduler dispose failed:', err instanceof Error ? err.message : err);
322
+ }
323
+ this._dreamScheduler = undefined;
324
+ }
268
325
  // Stop the bridge first so it doesn't try to publish to a disposed bus.
269
326
  if (this._experienceBridge) {
270
327
  await this._experienceBridge.stop();
@@ -2,7 +2,7 @@
2
2
  * Agentic QE v3 - Memory Backend
3
3
  * Hybrid memory implementation (in-memory + optional persistence)
4
4
  */
5
- import { MemoryBackend, StoreOptions, VectorSearchResult } from './interfaces';
5
+ import { MemoryBackend, StoreOptions, RetrieveOptions, VectorSearchResult } from './interfaces';
6
6
  export declare class InMemoryBackend implements MemoryBackend {
7
7
  private store;
8
8
  private vectors;
@@ -10,10 +10,10 @@ export declare class InMemoryBackend implements MemoryBackend {
10
10
  initialize(): Promise<void>;
11
11
  dispose(): Promise<void>;
12
12
  set<T>(key: string, value: T, options?: StoreOptions): Promise<void>;
13
- get<T>(key: string, namespace?: string): Promise<T | undefined>;
14
- delete(key: string, namespace?: string): Promise<boolean>;
15
- has(key: string, namespace?: string): Promise<boolean>;
16
- search(pattern: string, limit?: number): Promise<string[]>;
13
+ get<T>(key: string, options?: RetrieveOptions): Promise<T | undefined>;
14
+ delete(key: string, options?: RetrieveOptions): Promise<boolean>;
15
+ has(key: string, options?: RetrieveOptions): Promise<boolean>;
16
+ search(pattern: string, limit?: number, options?: RetrieveOptions): Promise<string[]>;
17
17
  vectorSearch(embedding: number[], k: number): Promise<VectorSearchResult[]>;
18
18
  storeVector(key: string, embedding: number[], metadata?: unknown): Promise<void>;
19
19
  private buildKey;