agentic-qe 3.9.18 → 3.9.20

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 (314) hide show
  1. package/.claude/helpers/statusline-v3.cjs +1 -1
  2. package/.claude/skills/skills-manifest.json +1 -1
  3. package/CHANGELOG.md +62 -0
  4. package/assets/skills/skills-manifest.json +1 -1
  5. package/dist/adapters/claude-flow/trajectory-bridge.d.ts +12 -1
  6. package/dist/adapters/claude-flow/trajectory-bridge.js +33 -31
  7. package/dist/cli/bundle.js +5 -5
  8. package/dist/cli/chunks/adapter-UOX57IAN.js +2 -0
  9. package/dist/cli/chunks/{agent-booster-wasm-RJHBIG5V.js → agent-booster-wasm-T5JB3MOF.js} +2 -2
  10. package/dist/cli/chunks/{agent-handler-CXS6EE2V.js → agent-handler-EASMQSQO.js} +2 -2
  11. package/dist/cli/chunks/{agent-memory-branch-7NV5DD5A.js → agent-memory-branch-7GWN2KCG.js} +2 -2
  12. package/dist/cli/chunks/aqe-learning-engine-KZES2SKE.js +2 -0
  13. package/dist/cli/chunks/{audit-3NWGSPJW.js → audit-VHV4GXPW.js} +2 -2
  14. package/dist/cli/chunks/base-7MXMBRSW.js +2 -0
  15. package/dist/cli/chunks/{better-sqlite3-NXOMSJDC.js → better-sqlite3-GNK7MDXZ.js} +2 -2
  16. package/dist/cli/chunks/{brain-handler-6N5WWZVA.js → brain-handler-ALXZKWO4.js} +3 -3
  17. package/dist/cli/chunks/{branch-enumerator-I7UTOCAW.js → branch-enumerator-JNYLOLMM.js} +2 -2
  18. package/dist/cli/chunks/{browser-6VOFWA52.js → browser-FXRW6LID.js} +2 -2
  19. package/dist/cli/chunks/browser-workflow-4C5R54CZ.js +2 -0
  20. package/dist/cli/chunks/{chunk-BFM47L3X.js → chunk-2J5OO63R.js} +2 -2
  21. package/dist/cli/chunks/{chunk-7OGUAZGJ.js → chunk-35HDLA22.js} +1 -1
  22. package/dist/cli/chunks/{chunk-P6HIDCTQ.js → chunk-3BFNYFXV.js} +1 -1
  23. package/dist/cli/chunks/{chunk-KFITGSW3.js → chunk-3CLKKAGH.js} +2 -2
  24. package/dist/cli/chunks/{chunk-WC5A7C5L.js → chunk-3GPNZPM4.js} +1 -1
  25. package/dist/cli/chunks/{chunk-HLXPD4Y2.js → chunk-3HQ4VKK6.js} +79 -67
  26. package/dist/cli/chunks/{chunk-ENYQUSSK.js → chunk-3ZHUKLU7.js} +2 -2
  27. package/dist/cli/chunks/{chunk-4BIWQLD3.js → chunk-4G6OH5LQ.js} +2 -2
  28. package/dist/cli/chunks/{chunk-ODGACHEZ.js → chunk-4HD7YRW7.js} +2 -2
  29. package/dist/cli/chunks/{chunk-MBGWDELE.js → chunk-4IUNBRKQ.js} +2 -2
  30. package/dist/cli/chunks/{chunk-S2XBAOXE.js → chunk-4PNLBMKY.js} +1 -1
  31. package/dist/cli/chunks/{chunk-FTIHPDWV.js → chunk-4SBMTHTA.js} +2 -2
  32. package/dist/cli/chunks/{chunk-H5JZZH2C.js → chunk-5GA4BUQU.js} +2 -2
  33. package/dist/cli/chunks/{chunk-AMRUZ6XG.js → chunk-5ILP2ZDZ.js} +2 -2
  34. package/dist/cli/chunks/{chunk-G2H4W7NN.js → chunk-5LM2W3NE.js} +1 -1
  35. package/dist/cli/chunks/{chunk-BGSYFAEJ.js → chunk-6LKEFWKI.js} +3 -3
  36. package/dist/cli/chunks/{chunk-MDCTQOUJ.js → chunk-6R7SJ5FS.js} +1 -1
  37. package/dist/cli/chunks/{chunk-7XLTLFP5.js → chunk-7I6ROJGF.js} +2 -2
  38. package/dist/cli/chunks/{chunk-4666TC3P.js → chunk-7J34I3CI.js} +2 -2
  39. package/dist/cli/chunks/{chunk-6QSB4XOL.js → chunk-7OGFOHG5.js} +2 -2
  40. package/dist/cli/chunks/{chunk-B6BAK2JI.js → chunk-7Q7SCQMQ.js} +2 -2
  41. package/dist/cli/chunks/{chunk-X2T4TI7D.js → chunk-7R45TEY6.js} +2 -2
  42. package/dist/cli/chunks/{chunk-27MW2RFA.js → chunk-7WXYQDML.js} +2 -2
  43. package/dist/cli/chunks/{chunk-IJPTWPXG.js → chunk-7Y4QQ6JL.js} +1 -1
  44. package/dist/cli/chunks/{chunk-QGSELG75.js → chunk-AFMLL2G3.js} +2 -2
  45. package/dist/cli/chunks/{chunk-JBW2A2O6.js → chunk-AVVRA6FG.js} +2 -2
  46. package/dist/cli/chunks/{chunk-2A4JCRAW.js → chunk-BIODM56C.js} +2 -2
  47. package/dist/cli/chunks/{chunk-KMHGQD76.js → chunk-BJF77EFA.js} +2 -2
  48. package/dist/cli/chunks/chunk-BKGCMWFL.js +12 -0
  49. package/dist/cli/chunks/{chunk-JMK5OCWL.js → chunk-BXGAXGME.js} +2 -2
  50. package/dist/cli/chunks/{chunk-RPT7HCMH.js → chunk-CEVIRL2S.js} +2 -2
  51. package/dist/cli/chunks/{chunk-DC3PADV3.js → chunk-CPVGZYEP.js} +1 -1
  52. package/dist/cli/chunks/chunk-CQSME43Z.js +69 -0
  53. package/dist/cli/chunks/{chunk-VRHKEJR6.js → chunk-DERQRIAR.js} +3 -3
  54. package/dist/cli/chunks/{chunk-XBWVHO6G.js → chunk-DJCLA5AG.js} +2 -2
  55. package/dist/cli/chunks/{chunk-EN2A2CVT.js → chunk-DODH6CEQ.js} +1 -1
  56. package/dist/cli/chunks/{chunk-4U2JKV44.js → chunk-DSPH4GI3.js} +1 -1
  57. package/dist/cli/chunks/{chunk-HZKY5KPB.js → chunk-EJQRDMON.js} +1 -1
  58. package/dist/cli/chunks/{chunk-OXL6JSVR.js → chunk-EYSGJZ7Y.js} +9 -9
  59. package/dist/cli/chunks/chunk-F32R4LVS.js +2 -0
  60. package/dist/cli/chunks/{chunk-DCB2VUYM.js → chunk-F3PX6EJX.js} +1 -1
  61. package/dist/cli/chunks/{chunk-RI3NTZ2I.js → chunk-FAQPPMEC.js} +2 -2
  62. package/dist/cli/chunks/{chunk-6G3RNT5H.js → chunk-FHDYN73D.js} +2 -2
  63. package/dist/cli/chunks/{chunk-DQCWNCOT.js → chunk-FPBNTPCM.js} +2 -2
  64. package/dist/cli/chunks/{chunk-TFUWIKGZ.js → chunk-FUTRX4ZT.js} +2 -2
  65. package/dist/cli/chunks/{chunk-IS2PMHB5.js → chunk-G7HYTJDG.js} +2 -2
  66. package/dist/cli/chunks/{chunk-4ELLGWTS.js → chunk-GJACTPDK.js} +2 -2
  67. package/dist/cli/chunks/{chunk-EZN7QMOZ.js → chunk-GXO42P3X.js} +4 -4
  68. package/dist/cli/chunks/{chunk-FKNYOKIK.js → chunk-H647PYXW.js} +1 -1
  69. package/dist/cli/chunks/{chunk-MLVVYUFS.js → chunk-HCFRGEMK.js} +1 -1
  70. package/dist/cli/chunks/{chunk-DOSDUAVZ.js → chunk-HW47UOFK.js} +2 -2
  71. package/dist/cli/chunks/{chunk-JGNVI5UB.js → chunk-HXQ7GAUV.js} +3 -3
  72. package/dist/cli/chunks/{chunk-BRWWIY6O.js → chunk-ICLWWAGZ.js} +2 -2
  73. package/dist/cli/chunks/{chunk-A26GU6YU.js → chunk-IHBRFVGA.js} +1 -1
  74. package/dist/cli/chunks/{chunk-ZURHHRSA.js → chunk-J7SDO52P.js} +2 -2
  75. package/dist/cli/chunks/{chunk-6ZMQL3U6.js → chunk-JCPXG42O.js} +2 -2
  76. package/dist/cli/chunks/{chunk-BSQTOKNR.js → chunk-K2D5L7YV.js} +1 -1
  77. package/dist/cli/chunks/{chunk-JZG23IPV.js → chunk-KMDZOVCF.js} +1 -1
  78. package/dist/cli/chunks/{chunk-VW7FKTFO.js → chunk-KNOZWD6E.js} +2 -2
  79. package/dist/cli/chunks/{chunk-JZTB35EQ.js → chunk-LATJ2LKJ.js} +1 -1
  80. package/dist/cli/chunks/{chunk-WMJCFDTA.js → chunk-LGSPAQSP.js} +2 -2
  81. package/dist/cli/chunks/{chunk-D7SS56EG.js → chunk-LJW7BTMK.js} +2 -2
  82. package/dist/cli/chunks/{chunk-ZHA5Z5V4.js → chunk-LSYMQG52.js} +1 -1
  83. package/dist/cli/chunks/{chunk-6KTF7QB3.js → chunk-MIST354H.js} +2 -2
  84. package/dist/cli/chunks/{chunk-AGPZVE6B.js → chunk-MXAEZHW6.js} +2 -2
  85. package/dist/cli/chunks/{chunk-6IBFYVLK.js → chunk-MXDGMXJA.js} +2 -2
  86. package/dist/cli/chunks/{chunk-R3U3ARVJ.js → chunk-MXHJUAM7.js} +2 -2
  87. package/dist/cli/chunks/{chunk-BXTHB2A2.js → chunk-NGWGOMOP.js} +2 -2
  88. package/dist/cli/chunks/{chunk-UNPTSPAO.js → chunk-NN6VRHNL.js} +2 -2
  89. package/dist/cli/chunks/{chunk-LVABI4OA.js → chunk-NQIOXSHW.js} +1 -1
  90. package/dist/cli/chunks/{chunk-CSYQKVZY.js → chunk-NWYYWFUO.js} +1 -1
  91. package/dist/cli/chunks/{chunk-CCM7MBLA.js → chunk-O3PLWCCD.js} +2 -2
  92. package/dist/cli/chunks/{chunk-3DLD7OMF.js → chunk-OD5SVOVP.js} +1 -1
  93. package/dist/cli/chunks/{chunk-FDDB7QTM.js → chunk-P2ABIGYB.js} +1 -1
  94. package/dist/cli/chunks/{chunk-QTUTQLOY.js → chunk-Q4OITFDX.js} +2 -2
  95. package/dist/cli/chunks/{chunk-3GA7M5NK.js → chunk-QAZYSC3T.js} +2 -2
  96. package/dist/cli/chunks/{chunk-UPP5V7Y3.js → chunk-QCLEA3CM.js} +2 -2
  97. package/dist/cli/chunks/{chunk-ZWR4PZ4Z.js → chunk-QKOPJ5CZ.js} +2 -2
  98. package/dist/cli/chunks/{chunk-Z4YHL4JU.js → chunk-QLZPCEVI.js} +1 -1
  99. package/dist/cli/chunks/{chunk-7GGSUXVM.js → chunk-QMGXALN3.js} +2 -2
  100. package/dist/cli/chunks/{chunk-SQHM6WUF.js → chunk-QMUZMIV7.js} +3 -3
  101. package/dist/cli/chunks/{chunk-5SZLQCFP.js → chunk-QQMHE4RT.js} +2 -2
  102. package/dist/cli/chunks/{chunk-NBQW7MXF.js → chunk-RCPFDAOC.js} +1 -1
  103. package/dist/cli/chunks/{chunk-JD6KE6DJ.js → chunk-RVWGW7TI.js} +2 -2
  104. package/dist/cli/chunks/{chunk-ZJEVL5O3.js → chunk-RXXKU3VP.js} +2 -2
  105. package/dist/cli/chunks/{chunk-AZGESIFV.js → chunk-RYBFRFKY.js} +1 -1
  106. package/dist/cli/chunks/{chunk-WKQSZTU6.js → chunk-S6SRHNJV.js} +2 -2
  107. package/dist/cli/chunks/{chunk-BADBKGZE.js → chunk-SGGY4QYU.js} +2 -2
  108. package/dist/cli/chunks/{chunk-YZIOM7JL.js → chunk-SH2UPGO7.js} +2 -2
  109. package/dist/cli/chunks/{chunk-PM77Z4PR.js → chunk-SL7WTN5Z.js} +2 -2
  110. package/dist/cli/chunks/{chunk-KV6PIOHN.js → chunk-SMQ5OARZ.js} +1 -1
  111. package/dist/cli/chunks/{chunk-YQL6JH2Y.js → chunk-SYXPLFK7.js} +2 -2
  112. package/dist/cli/chunks/{chunk-6BGSH2YR.js → chunk-T3TEQH2H.js} +1 -1
  113. package/dist/cli/chunks/{chunk-YNVVRND7.js → chunk-T5MMSSSF.js} +2 -2
  114. package/dist/cli/chunks/{chunk-BY44ODHD.js → chunk-TG6P44UT.js} +4 -4
  115. package/dist/cli/chunks/{chunk-TPL3CBMS.js → chunk-TV5OVFKK.js} +1 -1
  116. package/dist/cli/chunks/{chunk-54TOOHER.js → chunk-U7RTH6F4.js} +2 -2
  117. package/dist/cli/chunks/{chunk-XTCV5UOJ.js → chunk-UABC2Z3S.js} +2 -2
  118. package/dist/cli/chunks/{chunk-I3POPZT5.js → chunk-UAE37LHP.js} +2 -2
  119. package/dist/cli/chunks/{chunk-5ROA7KOT.js → chunk-UHWRRJBH.js} +1 -1
  120. package/dist/cli/chunks/{chunk-J7BG55VG.js → chunk-UNAVOVD7.js} +3 -3
  121. package/dist/cli/chunks/{chunk-MJ7UYPGY.js → chunk-V5UB75TQ.js} +2 -2
  122. package/dist/cli/chunks/{chunk-WH7ZOJCF.js → chunk-VQI6JQQP.js} +1 -1
  123. package/dist/cli/chunks/{chunk-KYLE6ZSC.js → chunk-WALYYW6B.js} +4 -4
  124. package/dist/cli/chunks/{chunk-UFGFV4BO.js → chunk-WF6MKBRI.js} +2 -2
  125. package/dist/cli/chunks/{chunk-F7XU7KZL.js → chunk-X3NADG4S.js} +2 -2
  126. package/dist/cli/chunks/{chunk-7ZIKFJ6X.js → chunk-XJRXB5Z5.js} +2 -2
  127. package/dist/cli/chunks/{chunk-V2N7KWT7.js → chunk-Y6U4CCPP.js} +1 -1
  128. package/dist/cli/chunks/{chunk-VXQK4GKV.js → chunk-YPUDYGIU.js} +1 -1
  129. package/dist/cli/chunks/{chunk-K5NFP7B5.js → chunk-YPVPWDKL.js} +2 -2
  130. package/dist/cli/chunks/{chunk-VZO5I23B.js → chunk-Z5MG54R4.js} +1 -1
  131. package/dist/cli/chunks/{chunk-QTNDHCZ7.js → chunk-Z65DB2Z7.js} +3 -3
  132. package/dist/cli/chunks/{chunk-XSLKR2DM.js → chunk-ZBBHJGPI.js} +2 -2
  133. package/dist/cli/chunks/{chunk-RGLCMGNZ.js → chunk-ZCH5MNST.js} +2 -2
  134. package/dist/cli/chunks/{chunk-QW2RFI73.js → chunk-ZTWHRDUY.js} +2 -2
  135. package/dist/cli/chunks/{ci-LYAVZLM3.js → ci-TE3744OR.js} +2 -2
  136. package/dist/cli/chunks/{ci-output-L7TR2NCN.js → ci-output-GSNS52SY.js} +2 -2
  137. package/dist/cli/chunks/{circuit-breaker-AQOGJGKI.js → circuit-breaker-7ROW7QBW.js} +2 -2
  138. package/dist/cli/chunks/{claude-flow-setup-SO2ZN26K.js → claude-flow-setup-Z5GPMILN.js} +2 -2
  139. package/dist/cli/chunks/client-S5TFLKHN.js +2 -0
  140. package/dist/cli/chunks/{cline-installer-XCXFH4UR.js → cline-installer-6D4SAAM4.js} +2 -2
  141. package/dist/cli/chunks/{code-3Z2HMS5I.js → code-JZKH7FRS.js} +2 -2
  142. package/dist/cli/chunks/{code-index-extractor-KE362AJX.js → code-index-extractor-JJFTZLOK.js} +2 -2
  143. package/dist/cli/chunks/{codex-installer-GTD3GFTF.js → codex-installer-O5KIPN3Z.js} +2 -2
  144. package/dist/cli/chunks/{completions-EDCXRRJO.js → completions-QNMAUYKK.js} +2 -2
  145. package/dist/cli/chunks/{complexity-analyzer-QMN3V6D3.js → complexity-analyzer-JYJ7TLYE.js} +2 -2
  146. package/dist/cli/chunks/{continuedev-installer-U6HN376C.js → continuedev-installer-JYMVLG6S.js} +2 -2
  147. package/dist/cli/chunks/{copilot-installer-54PZIREM.js → copilot-installer-SSV6GF5G.js} +2 -2
  148. package/dist/cli/chunks/{cost-tracker-33O475QA.js → cost-tracker-2VZ3IMJZ.js} +2 -2
  149. package/dist/cli/chunks/{coverage-B7E545AJ.js → coverage-KW4V5D5L.js} +3 -3
  150. package/dist/cli/chunks/cross-domain-router-GZG5GU7Q.js +2 -0
  151. package/dist/cli/chunks/{cursor-installer-LKKSPZUM.js → cursor-installer-QVGDAHOI.js} +2 -2
  152. package/dist/cli/chunks/{daemon-DVOHWXUR.js → daemon-JKMFDYK2.js} +3 -3
  153. package/dist/cli/chunks/{dag-attention-scheduler-EQOHQBUG.js → dag-attention-scheduler-WKRV7DFE.js} +2 -2
  154. package/dist/cli/chunks/{detect-OCB2XT6C.js → detect-ROCCKX63.js} +2 -2
  155. package/dist/cli/chunks/{dist-node-HSG4QK4G.js → dist-node-QGU7TJTW.js} +2 -2
  156. package/dist/cli/chunks/{domain-handler-USGF4CIG.js → domain-handler-3UJHQPOR.js} +2 -2
  157. package/dist/cli/chunks/{domain-transfer-OUERZRGL.js → domain-transfer-R47ISVU5.js} +2 -2
  158. package/dist/cli/chunks/dream-PGYTIOQS.js +2 -0
  159. package/dist/cli/chunks/embed-and-insert-pattern-ZVK7WSY2.js +3 -0
  160. package/dist/cli/chunks/{eval-LHYXXWFK.js → eval-WNZWXFOW.js} +2 -2
  161. package/dist/cli/chunks/{fast-paths-UTK7BN63.js → fast-paths-QPF47RZJ.js} +2 -2
  162. package/dist/cli/chunks/{feature-flags-XB6ALB3X.js → feature-flags-2MAHHM66.js} +2 -2
  163. package/dist/cli/chunks/{feature-flags-XEP6B4GN.js → feature-flags-PGIG2W3G.js} +2 -2
  164. package/dist/cli/chunks/{file-discovery-O4DUCNHK.js → file-discovery-JL6FCXRB.js} +2 -2
  165. package/dist/cli/chunks/{fleet-37NGGRJI.js → fleet-LMBZU2GU.js} +3 -3
  166. package/dist/cli/chunks/{gnn-wrapper-5E7T3IQX.js → gnn-wrapper-GFNFVEER.js} +2 -2
  167. package/dist/cli/chunks/{heartbeat-handler-Q44PCI7K.js → heartbeat-handler-YN7ES3AX.js} +4 -4
  168. package/dist/cli/chunks/{heartbeat-scheduler-6JPB2AQS.js → heartbeat-scheduler-SII2KJSQ.js} +2 -2
  169. package/dist/cli/chunks/hnsw-adapter-ANJKCXK6.js +2 -0
  170. package/dist/cli/chunks/hnsw-index-D4CJEP7L.js +2 -0
  171. package/dist/cli/chunks/{hnsw-legacy-bridge-B55GGQYA.js → hnsw-legacy-bridge-CPMBYE7C.js} +2 -2
  172. package/dist/cli/chunks/{hnswlib-node-B3D2XIL5.js → hnswlib-node-NWNBNU3W.js} +2 -2
  173. package/dist/cli/chunks/hooks-EYSB7XDW.js +225 -0
  174. package/dist/cli/chunks/{hybrid-router-RV34PYQD.js → hybrid-router-BR7O6WT2.js} +2 -2
  175. package/dist/cli/chunks/{hypergraph-engine-FT5YK5RF.js → hypergraph-engine-HAKGWDYX.js} +2 -2
  176. package/dist/cli/chunks/{hypergraph-handler-EUS6MIYW.js → hypergraph-handler-UCI3LXUF.js} +3 -3
  177. package/dist/cli/chunks/impact-analyzer-55JW3OK6.js +2 -0
  178. package/dist/cli/chunks/{init-handler-3MV32TKZ.js → init-handler-7RYGU3W5.js} +6 -6
  179. package/dist/cli/chunks/init-wizard-MWKJNVB2.js +2 -0
  180. package/dist/cli/chunks/kernel-5MKKDS4J.js +2 -0
  181. package/dist/cli/chunks/{kilocode-installer-RZPRXQI2.js → kilocode-installer-W6ITMEFA.js} +2 -2
  182. package/dist/cli/chunks/{kiro-installer-BGDBNZHI.js → kiro-installer-2BO34D3O.js} +2 -2
  183. package/dist/cli/chunks/knowledge-graph-2A7AE7L7.js +2 -0
  184. package/dist/cli/chunks/{learning-KNEBWLEZ.js → learning-GEXYG72Z.js} +3 -3
  185. package/dist/cli/chunks/{llm-router-Q2VQPOQ3.js → llm-router-EGHA5YOC.js} +4 -4
  186. package/dist/cli/chunks/{load-RL53SYBD.js → load-VU2OOAEF.js} +2 -2
  187. package/dist/cli/chunks/load-test-UD4ZXCGG.js +2 -0
  188. package/dist/cli/chunks/{mcp-GTINFFUF.js → mcp-NVQFFQ2R.js} +2 -2
  189. package/dist/cli/chunks/{memory-STPMUUAK.js → memory-JNXMKTZQ.js} +5 -5
  190. package/dist/cli/chunks/memory-backend-X3Z4IAYG.js +2 -0
  191. package/dist/cli/chunks/{memory-handlers-LWX3LPVF.js → memory-handlers-NLGQ5I7K.js} +2 -2
  192. package/dist/cli/chunks/{multi-model-executor-36ZYYDA6.js → multi-model-executor-SG6OME2A.js} +2 -2
  193. package/dist/cli/chunks/{opencode-installer-KTCQKS2K.js → opencode-installer-AY4JCZIM.js} +2 -2
  194. package/dist/cli/chunks/{orchestrator-6EGOOXQG.js → orchestrator-GWI7HQG6.js} +6 -6
  195. package/dist/cli/chunks/{pipeline-WSLAIOYC.js → pipeline-7T6IAMC7.js} +2 -2
  196. package/dist/cli/chunks/{platform-MNUN663B.js → platform-IXUST66M.js} +2 -2
  197. package/dist/cli/chunks/{plugin-PLDTG4A2.js → plugin-PW7F6MVH.js} +2 -2
  198. package/dist/cli/chunks/{prime-radiant-advanced-wasm-B4UFONWB.js → prime-radiant-advanced-wasm-BUAZHZCM.js} +2 -2
  199. package/dist/cli/chunks/protocol-executor-AB6KPFK5.js +2 -0
  200. package/dist/cli/chunks/{protocol-handler-VAVLLAI2.js → protocol-handler-6746OC4P.js} +2 -2
  201. package/dist/cli/chunks/{prove-WVNPDWUC.js → prove-VYV5DQGC.js} +2 -2
  202. package/dist/cli/chunks/{provider-manager-VJF4D6AW.js → provider-manager-GEO3CUOO.js} +3 -3
  203. package/dist/cli/chunks/qe-reasoning-bank-Y4IDDIYA.js +2 -0
  204. package/dist/cli/chunks/{quality-LTMHVQBG.js → quality-4XXENNNW.js} +2 -2
  205. package/dist/cli/chunks/queen-coordinator-GBSTXGA2.js +2 -0
  206. package/dist/cli/chunks/{real-embeddings-6ACQACTM.js → real-embeddings-ZVEZVXVT.js} +2 -2
  207. package/dist/cli/chunks/{roocode-installer-T5ZWC3SS.js → roocode-installer-ZRNDOIDL.js} +2 -2
  208. package/dist/cli/chunks/router-JA2X4MF6.js +2 -0
  209. package/dist/cli/chunks/routing-feedback-YCVJIWFM.js +2 -0
  210. package/dist/cli/chunks/{routing-handler-Y2O2I2HM.js → routing-handler-MPSJ7DDI.js} +2 -2
  211. package/dist/cli/chunks/{ruvector-commands-F2V36B4W.js → ruvector-commands-V4BVCY2U.js} +2 -2
  212. package/dist/cli/chunks/{rvf-dual-writer-R6CNMPQD.js → rvf-dual-writer-X4VNU5KH.js} +2 -2
  213. package/dist/cli/chunks/{rvf-migration-adapter-IDVOB3LN.js → rvf-migration-adapter-KOYYJSNH.js} +2 -2
  214. package/dist/cli/chunks/{rvf-migration-coordinator-VM4AMFZG.js → rvf-migration-coordinator-SF5IBKTK.js} +2 -2
  215. package/dist/cli/chunks/rvf-native-adapter-5YN7EEB5.js +2 -0
  216. package/dist/cli/chunks/safe-db-S46Y7IC5.js +2 -0
  217. package/dist/cli/chunks/schedule-KSDHFWSY.js +2 -0
  218. package/dist/cli/chunks/scheduler-PLFJHU54.js +2 -0
  219. package/dist/cli/chunks/{security-WQ7YMR6M.js → security-AA5GBNNU.js} +3 -3
  220. package/dist/cli/chunks/shared-rvf-adapter-MLXVW4N6.js +2 -0
  221. package/dist/cli/chunks/{shared-rvf-dual-writer-HYI64CBX.js → shared-rvf-dual-writer-EGP3BYIY.js} +2 -2
  222. package/dist/cli/chunks/sqlite-persistence-RK3JWKB4.js +2 -0
  223. package/dist/cli/chunks/{status-handler-BH2WCMPA.js → status-handler-ARHPRXJ4.js} +2 -2
  224. package/dist/cli/chunks/{structural-health-XWX6FKVF.js → structural-health-IDV4RBZV.js} +2 -2
  225. package/dist/cli/chunks/{sync-PRDGCHE2.js → sync-7BRLSLDG.js} +2 -2
  226. package/dist/cli/chunks/{task-handler-YFHFBMHO.js → task-handler-XY42QA3K.js} +2 -2
  227. package/dist/cli/chunks/task-handlers-QEHOKEJC.js +9 -0
  228. package/dist/cli/chunks/{test-ZBTQ4Z66.js → test-TQIHDBEX.js} +4 -4
  229. package/dist/cli/chunks/{test-scheduling-F47Y3KNO.js → test-scheduling-BBVOLGFT.js} +3 -3
  230. package/dist/cli/chunks/{token-bootstrap-XOGAEQPG.js → token-bootstrap-BUHTWVEF.js} +2 -2
  231. package/dist/cli/chunks/{token-usage-2KZ7WE5J.js → token-usage-MRVQ7G3H.js} +2 -2
  232. package/dist/cli/chunks/{transformers-KCJ7PWZ4.js → transformers-3PFLFSWR.js} +2 -2
  233. package/dist/cli/chunks/{tree-sitter-wasm-parser-H6DL2DFA.js → tree-sitter-wasm-parser-6GDZQNFV.js} +2 -2
  234. package/dist/cli/chunks/{types-633TMIO3.js → types-F2LWFMRI.js} +2 -2
  235. package/dist/cli/chunks/unified-memory-JVZZMZRE.js +2 -0
  236. package/dist/cli/chunks/unified-memory-hnsw-EJJHCMFR.js +2 -0
  237. package/dist/cli/chunks/unified-persistence-IEKOYCBL.js +2 -0
  238. package/dist/cli/chunks/{upgrade-CH742GRF.js → upgrade-N676MSDA.js} +2 -2
  239. package/dist/cli/chunks/{validate-44WH3CKE.js → validate-56AA6YYM.js} +2 -2
  240. package/dist/cli/chunks/{validate-swarm-W2A7CUM7.js → validate-swarm-YPHV7MMC.js} +2 -2
  241. package/dist/cli/chunks/{vibium-B25MIEBK.js → vibium-ABPFT3DX.js} +2 -2
  242. package/dist/cli/chunks/visual-security-APS7K3TZ.js +2 -0
  243. package/dist/cli/chunks/{web-tree-sitter-B54K47HF.js → web-tree-sitter-KN4PWKMV.js} +2 -2
  244. package/dist/cli/chunks/{windsurf-installer-EWL7COTI.js → windsurf-installer-IZOJBDNN.js} +2 -2
  245. package/dist/cli/chunks/witness-chain-DMHO7R75.js +2 -0
  246. package/dist/cli/chunks/{witness-chain-DWNP7VR6.js → witness-chain-H2DM5WMB.js} +2 -2
  247. package/dist/cli/chunks/{workflow-LT2J7U23.js → workflow-R42PK45F.js} +4 -4
  248. package/dist/cli/chunks/workflow-orchestrator-BDHRNVOG.js +2 -0
  249. package/dist/cli/chunks/{wrappers-OAZ6MKXO.js → wrappers-6TIJNWN4.js} +2 -2
  250. package/dist/cli/commands/hooks-handlers/command-hooks.js +104 -11
  251. package/dist/cli/commands/hooks-handlers/hooks-dream-learning.d.ts +98 -0
  252. package/dist/cli/commands/hooks-handlers/hooks-dream-learning.js +339 -1
  253. package/dist/cli/commands/hooks-handlers/hooks-shared.d.ts +20 -1
  254. package/dist/cli/commands/hooks-handlers/hooks-shared.js +35 -3
  255. package/dist/cli/commands/hooks-handlers/routing-hooks.js +15 -5
  256. package/dist/cli/commands/hooks-handlers/task-hooks.js +216 -5
  257. package/dist/cli/commands/init.js +3 -1
  258. package/dist/coordination/consensus/providers/claude-provider.js +1 -1
  259. package/dist/coordination/task-executor.js +11 -2
  260. package/dist/init/phases/07-hooks.js +2 -2
  261. package/dist/integrations/agentic-flow/reasoning-bank/experience-replay.js +82 -0
  262. package/dist/integrations/ruvector/hypergraph-engine.js +63 -4
  263. package/dist/integrations/ruvector/hypergraph-schema.d.ts +6 -2
  264. package/dist/learning/dream/dream-engine.js +8 -0
  265. package/dist/learning/embed-and-insert-pattern.d.ts +36 -0
  266. package/dist/learning/embed-and-insert-pattern.js +52 -0
  267. package/dist/learning/pattern-store.d.ts +8 -0
  268. package/dist/learning/pattern-store.js +66 -43
  269. package/dist/mcp/bundle.js +372 -357
  270. package/dist/mcp/entry.js +36 -1
  271. package/dist/mcp/handlers/core-handlers.js +2 -2
  272. package/dist/mcp/handlers/task-handlers.js +45 -0
  273. package/dist/mcp/handlers/trajectory-judge.d.ts +13 -0
  274. package/dist/mcp/handlers/trajectory-judge.js +100 -0
  275. package/dist/shared/llm/providers/claude.js +1 -1
  276. package/dist/workers/workers/learning-consolidation.js +6 -1
  277. package/package.json +1 -1
  278. package/dist/cli/chunks/adapter-C7AKAAPC.js +0 -2
  279. package/dist/cli/chunks/aqe-learning-engine-7P3AXQNO.js +0 -2
  280. package/dist/cli/chunks/base-GIDVLEPA.js +0 -2
  281. package/dist/cli/chunks/browser-workflow-DAUS4Z5V.js +0 -2
  282. package/dist/cli/chunks/chunk-4XYQJ4LQ.js +0 -2
  283. package/dist/cli/chunks/chunk-NKOLFLXF.js +0 -66
  284. package/dist/cli/chunks/chunk-RHYGRUNU.js +0 -24
  285. package/dist/cli/chunks/client-LIKTMSIP.js +0 -2
  286. package/dist/cli/chunks/cross-domain-router-SSBT32Q3.js +0 -2
  287. package/dist/cli/chunks/dream-FAHB6BWB.js +0 -2
  288. package/dist/cli/chunks/hnsw-adapter-GQM3ONQE.js +0 -2
  289. package/dist/cli/chunks/hnsw-index-XF3NY4R4.js +0 -2
  290. package/dist/cli/chunks/hooks-MOBQSJLJ.js +0 -101
  291. package/dist/cli/chunks/impact-analyzer-V6PBIMZH.js +0 -2
  292. package/dist/cli/chunks/init-wizard-7ROJWLEO.js +0 -2
  293. package/dist/cli/chunks/kernel-AOUBGDXU.js +0 -2
  294. package/dist/cli/chunks/knowledge-graph-SJA3YGMQ.js +0 -2
  295. package/dist/cli/chunks/load-test-NSHIGHCV.js +0 -2
  296. package/dist/cli/chunks/memory-backend-SZAYMQVP.js +0 -2
  297. package/dist/cli/chunks/protocol-executor-22KKAYX2.js +0 -2
  298. package/dist/cli/chunks/qe-reasoning-bank-N7ZXOAEN.js +0 -2
  299. package/dist/cli/chunks/queen-coordinator-BC54OCHH.js +0 -2
  300. package/dist/cli/chunks/router-YTQZRTIB.js +0 -2
  301. package/dist/cli/chunks/routing-feedback-AASAMEUY.js +0 -2
  302. package/dist/cli/chunks/rvf-native-adapter-VHIHJOPA.js +0 -2
  303. package/dist/cli/chunks/safe-db-NVEBL662.js +0 -2
  304. package/dist/cli/chunks/schedule-KVUFE56T.js +0 -2
  305. package/dist/cli/chunks/scheduler-6GRLJZ2A.js +0 -2
  306. package/dist/cli/chunks/shared-rvf-adapter-XORIDF3Q.js +0 -2
  307. package/dist/cli/chunks/sqlite-persistence-25TDMX6G.js +0 -2
  308. package/dist/cli/chunks/task-handlers-4OQRADMG.js +0 -2
  309. package/dist/cli/chunks/unified-memory-BTX45KY5.js +0 -2
  310. package/dist/cli/chunks/unified-memory-hnsw-MMHMQ4CP.js +0 -2
  311. package/dist/cli/chunks/unified-persistence-GA7HKYZC.js +0 -2
  312. package/dist/cli/chunks/visual-security-HPF5HCYF.js +0 -2
  313. package/dist/cli/chunks/witness-chain-LROQLFND.js +0 -2
  314. package/dist/cli/chunks/workflow-orchestrator-VFRKGG5Y.js +0 -2
@@ -117,6 +117,30 @@ export async function initializeHooksSystem() {
117
117
  state.initialized = true;
118
118
  }
119
119
  }
120
+ /**
121
+ * Hook-side busy_timeout (ADR-001 Option C / patch 260).
122
+ *
123
+ * Hooks fire from short-lived `npx aqe hooks ...` subprocesses. They open the
124
+ * shared memory.db while MCP-daemon workers may be holding the WAL write-lock
125
+ * for several seconds during dream-cycle / pattern-promotion. With the default
126
+ * 5s busy_timeout, hooks fail under contention. With 60s, they wait patiently
127
+ * — the hook subprocess exits as soon as it's done, so the longer timeout has
128
+ * no broader cost.
129
+ *
130
+ * Workers in MCP still use the platform default (5s) so they fail fast and
131
+ * retry on the next tick — they yield the lock to hooks under contention.
132
+ *
133
+ * This is per-connection: setting the pragma in a hook subprocess only affects
134
+ * that subprocess's connection, not the MCP daemon's.
135
+ */
136
+ export function applyHookBusyTimeout(db) {
137
+ try {
138
+ db.pragma('busy_timeout = 60000');
139
+ }
140
+ catch {
141
+ // No-op if pragma fails (mocked DBs in tests, etc.)
142
+ }
143
+ }
120
144
  /**
121
145
  * Create hybrid backend with timeout protection
122
146
  *
@@ -126,13 +150,21 @@ export async function initializeHooksSystem() {
126
150
  export async function createHybridBackendWithTimeout(dataDir) {
127
151
  const timeoutMs = 5000;
128
152
  // ADR-046: Use unified memory.db path - same as all other components
129
- // HybridMemoryBackend is a facade over UnifiedMemoryManager
153
+ // HybridMemoryBackend is a facade over UnifiedMemoryManager.
154
+ //
155
+ // ADR-001 Option C / patch 260: hooks open with a 60s busy_timeout so they
156
+ // wait patiently through worker bursts (dream-cycle / pattern-promotion
157
+ // can hold the WAL write-lock for several seconds). Hooks fire from a
158
+ // short-lived `npx aqe hooks ...` process — our 60s timeout here only
159
+ // affects the hook process; the MCP daemon's worker connections inherit
160
+ // the platform default (5s) so they fail fast and retry next tick,
161
+ // yielding the lock to hooks under contention.
130
162
  const backend = new HybridMemoryBackend({
131
163
  sqlite: {
132
164
  path: path.join(dataDir, 'memory.db'), // ADR-046: Unified storage
133
165
  walMode: true,
134
166
  poolSize: 3,
135
- busyTimeout: 5000,
167
+ busyTimeout: 60000,
136
168
  },
137
169
  // agentdb.path is ignored - vectors stored in unified memory.db
138
170
  enableFallback: true,
@@ -220,5 +252,5 @@ export function printGuidance(guidance) {
220
252
  // ============================================================================
221
253
  // Dream Scheduler & Learning — re-exported from hooks-dream-learning.ts
222
254
  // ============================================================================
223
- export { DREAM_STATE_KEY, DREAM_INTERVAL_MS, DREAM_EXPERIENCE_THRESHOLD, DREAM_MIN_GAP_MS, checkAndTriggerDream, incrementDreamExperience, persistCommandExperience, consolidateExperiencesToPatterns, } from './hooks-dream-learning.js';
255
+ export { DREAM_STATE_KEY, DREAM_INTERVAL_MS, DREAM_EXPERIENCE_THRESHOLD, DREAM_MIN_GAP_MS, checkAndTriggerDream, incrementDreamExperience, persistCommandExperience, persistTaskOutcome, updateHookRouterQValue, updateRoutingOutcomeQuality, consolidateExperiencesToPatterns, } from './hooks-dream-learning.js';
224
256
  //# sourceMappingURL=hooks-shared.js.map
@@ -8,7 +8,7 @@ import { randomUUID } from 'crypto';
8
8
  import chalk from 'chalk';
9
9
  import path from 'node:path';
10
10
  import { findProjectRoot } from '../../../kernel/unified-memory.js';
11
- import { getHooksSystem, createHybridBackendWithTimeout, incrementDreamExperience, printJson, printError, printGuidance, } from './hooks-shared.js';
11
+ import { applyHookBusyTimeout, getHooksSystem, createHybridBackendWithTimeout, incrementDreamExperience, printJson, printError, printGuidance, } from './hooks-shared.js';
12
12
  /**
13
13
  * Read piped stdin with a short timeout. Claude Code delivers
14
14
  * UserPromptSubmit / PostToolUse / etc. events as JSON on stdin —
@@ -147,7 +147,15 @@ export function registerRoutingHooks(hooks) {
147
147
  await um.initialize();
148
148
  }
149
149
  const db = um.getDatabase();
150
+ applyHookBusyTimeout(db);
150
151
  const outcomeId = `route-${Date.now()}-${randomUUID().slice(0, 8)}`;
152
+ // Split-write semantics: quality_score means "outcome quality after
153
+ // task ran" (6-dim formula), NOT routing confidence. Routing-
154
+ // confidence stays in decision_json. We write a sentinel
155
+ // (success=0, quality_score=-1) so post-task UPDATE fills the actual
156
+ // quality. lowConfidence is surfaced via decision_json + the error
157
+ // column so it's visible in queries that don't parse JSON.
158
+ const lowConfidence = routing.confidence < 0.5;
151
159
  db.prepare(`
152
160
  INSERT OR REPLACE INTO routing_outcomes (
153
161
  id, task_json, decision_json, used_agent,
@@ -158,10 +166,12 @@ export function registerRoutingHooks(hooks) {
158
166
  recommended: routing.recommendedAgent,
159
167
  confidence: routing.confidence,
160
168
  alternatives: routing.alternatives,
161
- }), routing.recommendedAgent, 1, // followed_recommendation = true (recommendation stage)
162
- 1, // success = true (routing itself succeeded)
163
- routing.confidence, 0, // duration not tracked at routing stage
164
- null);
169
+ lowConfidence,
170
+ }), routing.recommendedAgent, 1, // followed_recommendation = true
171
+ 0, // success = 0 (sentinel post-task UPDATEs)
172
+ -1, // quality_score = -1 sentinel
173
+ 0, // duration not yet tracked
174
+ lowConfidence ? 'low-confidence' : null);
165
175
  // Increment dream experience counter
166
176
  const projectRoot = findProjectRoot();
167
177
  const dataDir = path.join(projectRoot, '.agentic-qe');
@@ -4,11 +4,52 @@
4
4
  *
5
5
  * Handles task lifecycle hooks for pattern learning.
6
6
  */
7
+ import { createHash, randomUUID } from 'node:crypto';
7
8
  import chalk from 'chalk';
8
9
  import path from 'node:path';
9
10
  import { QE_HOOK_EVENTS } from '../../../learning/qe-hooks.js';
10
- import { findProjectRoot } from '../../../kernel/unified-memory.js';
11
- import { getHooksSystem, createHybridBackendWithTimeout, incrementDreamExperience, checkAndTriggerDream, printJson, printSuccess, } from './hooks-shared.js';
11
+ import { findProjectRoot, getUnifiedMemory } from '../../../kernel/unified-memory.js';
12
+ import { applyHookBusyTimeout, getHooksSystem, createHybridBackendWithTimeout, incrementDreamExperience, checkAndTriggerDream, persistTaskOutcome, updateHookRouterQValue, updateRoutingOutcomeQuality, printJson, printSuccess, } from './hooks-shared.js';
13
+ // ============================================================================
14
+ // Constants — task-bridge / routing-quality / q-learning
15
+ // ============================================================================
16
+ /** kv_store namespace key for cross-subprocess pre-task → post-task bridge */
17
+ const TASK_BRIDGE_NAMESPACE = 'task-bridge';
18
+ /** Bridge TTL: a Task() invocation rarely exceeds this — older entries are stale */
19
+ const TASK_BRIDGE_TTL_MS = 600_000; // 10 minutes
20
+ /** Confidence floor below which we flag the route as low-confidence (patch 320) */
21
+ const LOW_CONFIDENCE_THRESHOLD = 0.5;
22
+ // ============================================================================
23
+ // Helpers
24
+ // ============================================================================
25
+ /**
26
+ * Derive a structural taskType from a free-form task description.
27
+ * Mirrors the categories the q-learning router cares about (ADR-061/087).
28
+ */
29
+ function deriveTaskType(description) {
30
+ const d = description.toLowerCase();
31
+ if (/\bgenerate[- ]?test|\btest[- ]?gen|\bgenerate.+spec/.test(d))
32
+ return 'test-generation';
33
+ if (/\bcoverage|\banalyze.+cover/.test(d))
34
+ return 'coverage-analysis';
35
+ if (/\bquality|\bassess|\baudit/.test(d))
36
+ return 'quality-assessment';
37
+ if (/\bsecurity|\bvulnerab|\bcompliance/.test(d))
38
+ return 'security-compliance';
39
+ if (/\bdefect|\bbug|\bdiagnos/.test(d))
40
+ return 'defect-intelligence';
41
+ if (/\brequirement|\bspec\b/.test(d))
42
+ return 'requirements-validation';
43
+ if (/\brefactor|\brewrite|\boptim/.test(d))
44
+ return 'refactoring';
45
+ if (/\btest|\brun.+test/.test(d))
46
+ return 'test-execution';
47
+ return 'unknown';
48
+ }
49
+ /** Hash a description to a stable short bridge key. */
50
+ function hashDescription(description) {
51
+ return createHash('sha256').update(description).digest('hex').slice(0, 16);
52
+ }
12
53
  /**
13
54
  * Register pre-task and post-task subcommands on the hooks command.
14
55
  */
@@ -35,6 +76,132 @@ export function registerTaskHooks(hooks) {
35
76
  routing = result.value;
36
77
  }
37
78
  }
79
+ // Patch 050: top-5 selectedPatternIds for downstream per-pattern feedback
80
+ const selectedPatternIds = (routing?.patterns ?? [])
81
+ .slice(0, 5)
82
+ .map((p) => p?.id)
83
+ .filter((id) => typeof id === 'string');
84
+ // Patches 090/100/160/300/320: signals derived from memory.db.
85
+ // All best-effort: failures fall through to empty/default values.
86
+ let historicalBest = null;
87
+ let priorVerdicts = [];
88
+ let estimatedTokenSavings = 0;
89
+ let bridgeKey = null;
90
+ try {
91
+ const um = getUnifiedMemory();
92
+ if (!um.isInitialized()) {
93
+ await um.initialize();
94
+ }
95
+ const db = um.getDatabase();
96
+ applyHookBusyTimeout(db);
97
+ // Patch 090: best-historical-agent across past successful routes
98
+ try {
99
+ const row = db.prepare(`
100
+ SELECT used_agent AS agent,
101
+ ROUND(AVG(quality_score), 3) AS avgQuality,
102
+ COUNT(*) AS n
103
+ FROM routing_outcomes
104
+ WHERE success = 1 AND quality_score >= 0
105
+ GROUP BY used_agent
106
+ ORDER BY avgQuality DESC, n DESC
107
+ LIMIT 1
108
+ `).get();
109
+ if (row)
110
+ historicalBest = row;
111
+ }
112
+ catch { /* table may be empty */ }
113
+ // Patch 100: surface recent verdicts namespace for context reuse
114
+ try {
115
+ const rows = db.prepare(`
116
+ SELECT key, value
117
+ FROM kv_store
118
+ WHERE namespace = 'verdicts'
119
+ AND created_at > datetime('now', '-7 days')
120
+ ORDER BY created_at DESC
121
+ LIMIT 3
122
+ `).all();
123
+ priorVerdicts = rows.map((r) => ({
124
+ key: r.key,
125
+ summary: String(r.value).slice(0, 200),
126
+ }));
127
+ }
128
+ catch { /* table may be empty */ }
129
+ // Patch 300: bootstrap estimatedTokenSavings from selected patterns
130
+ if (selectedPatternIds.length > 0) {
131
+ try {
132
+ const placeholders = selectedPatternIds.map(() => '?').join(',');
133
+ const tokRow = db.prepare(`
134
+ SELECT COALESCE(SUM(average_token_savings), 0) AS sum
135
+ FROM qe_patterns
136
+ WHERE id IN (${placeholders})
137
+ `).get(...selectedPatternIds);
138
+ estimatedTokenSavings = Math.max(0, Math.round(tokRow?.sum ?? 0));
139
+ }
140
+ catch { /* column may not exist on older schemas */ }
141
+ }
142
+ // Patch 160 + 280-bridge: write the task-bridge entry that post-task
143
+ // will consume to fan out experience_applications per pattern_id and
144
+ // derive a structural q-learning state_key.
145
+ if (options.description && selectedPatternIds.length > 0) {
146
+ try {
147
+ const description = String(options.description);
148
+ const taskType = deriveTaskType(description);
149
+ const priority = 'normal';
150
+ const domain = routing?.domains?.[0] ?? 'any';
151
+ const complexityBucket = Math.max(0, Math.min(10, Math.round(Math.min(description.length / 200, 1) * 10)));
152
+ bridgeKey = `task:${hashDescription(description)}`;
153
+ const payload = JSON.stringify({
154
+ selectedPatternIds,
155
+ agent: routing?.recommendedAgent ?? null,
156
+ description: description.slice(0, 200),
157
+ taskType,
158
+ priority,
159
+ domain,
160
+ complexityBucket,
161
+ estimatedTokenSavings,
162
+ ts: Date.now(),
163
+ });
164
+ const expiresAt = Date.now() + TASK_BRIDGE_TTL_MS;
165
+ db.prepare(`
166
+ INSERT OR REPLACE INTO kv_store (key, namespace, value, expires_at, created_at)
167
+ VALUES (?, ?, ?, ?, strftime('%s','now')*1000)
168
+ `).run(bridgeKey, TASK_BRIDGE_NAMESPACE, payload, expiresAt);
169
+ }
170
+ catch (bridgeErr) {
171
+ console.error(chalk.dim(`[hooks] pre-task bridge: ${bridgeErr instanceof Error ? bridgeErr.message : 'unknown'}`));
172
+ }
173
+ }
174
+ // Patch 150: write a routing_outcomes sentinel that post-task UPDATEs
175
+ // with the 6-dim outcome quality. Pre-task cannot know quality yet.
176
+ // success=0/quality=-1 sentinel pair makes the row easy to find later.
177
+ if (routing?.recommendedAgent && options.taskId) {
178
+ try {
179
+ const outcomeId = `route-${Date.now()}-${randomUUID().slice(0, 8)}`;
180
+ const lowConfidence = routing.confidence < LOW_CONFIDENCE_THRESHOLD;
181
+ db.prepare(`
182
+ INSERT INTO routing_outcomes (
183
+ id, task_json, decision_json, used_agent,
184
+ followed_recommendation, success, quality_score,
185
+ duration_ms, error
186
+ ) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?)
187
+ `).run(outcomeId, JSON.stringify({ description: options.description, taskId: options.taskId }), JSON.stringify({
188
+ recommended: routing.recommendedAgent,
189
+ confidence: routing.confidence,
190
+ alternatives: routing.alternatives,
191
+ lowConfidence,
192
+ }), routing.recommendedAgent, 1, 0, // success = 0 (sentinel — post-task UPDATEs to actual)
193
+ -1, // quality_score = -1 sentinel
194
+ 0, lowConfidence ? 'low-confidence' : null);
195
+ }
196
+ catch (sentinelErr) {
197
+ console.error(chalk.dim(`[hooks] pre-task sentinel: ${sentinelErr instanceof Error ? sentinelErr.message : 'unknown'}`));
198
+ }
199
+ }
200
+ }
201
+ catch (memErr) {
202
+ console.error(chalk.dim(`[hooks] pre-task memory: ${memErr instanceof Error ? memErr.message : 'unknown'}`));
203
+ }
204
+ const lowConfidence = routing ? routing.confidence < LOW_CONFIDENCE_THRESHOLD : false;
38
205
  if (options.json) {
39
206
  printJson({
40
207
  success: true,
@@ -43,6 +210,18 @@ export function registerTaskHooks(hooks) {
43
210
  recommendedAgent: routing?.recommendedAgent,
44
211
  confidence: routing?.confidence,
45
212
  guidance: routing?.guidance || [],
213
+ // Patch 050
214
+ selectedPatternIds,
215
+ // Patch 090
216
+ historicalBest,
217
+ // Patch 100
218
+ priorVerdicts,
219
+ // Patch 300
220
+ estimatedTokenSavings,
221
+ // Patch 320
222
+ lowConfidence,
223
+ // Bridge identifier so post-task can correlate (debug aid)
224
+ bridgeKey,
46
225
  });
47
226
  }
48
227
  else {
@@ -51,6 +230,9 @@ export function registerTaskHooks(hooks) {
51
230
  if (routing) {
52
231
  console.log(chalk.bold('\n🎯 Recommended:'), chalk.cyan(routing.recommendedAgent));
53
232
  console.log(chalk.dim(` Confidence: ${(routing.confidence * 100).toFixed(1)}%`));
233
+ if (lowConfidence) {
234
+ console.log(chalk.yellow(' ⚠ Low confidence — consider providing more context'));
235
+ }
54
236
  }
55
237
  }
56
238
  return;
@@ -95,14 +277,43 @@ export function registerTaskHooks(hooks) {
95
277
  // Record as learning experience for every post-task invocation
96
278
  if (options.taskId) {
97
279
  const agent = options.agent || 'unknown';
280
+ const durationMs = options.duration ? parseInt(options.duration, 10) : 0;
98
281
  await reasoningBank.recordOutcome({
99
282
  patternId: `task:${agent}:${options.taskId}`,
100
283
  success,
101
- metrics: {
102
- executionTimeMs: options.duration ? parseInt(options.duration, 10) : 0,
103
- },
284
+ metrics: { executionTimeMs: durationMs },
104
285
  feedback: `Agent: ${agent}, Task: ${options.taskId}`,
105
286
  });
287
+ // Stream B: full experience pipeline (captured_experiences,
288
+ // experience_applications + per-pattern fan-out, qe_trajectories
289
+ // single-step + multi-step stitch, dream_insights.applied bump).
290
+ // Patches 060/110/120/160/180/300.
291
+ const outcome = await persistTaskOutcome({
292
+ taskId: options.taskId,
293
+ agent,
294
+ durationMs,
295
+ success,
296
+ });
297
+ // Stream D (patch 150): apply 6-dim outcome quality to the
298
+ // routing_outcomes sentinel that pre-task wrote with quality=-1.
299
+ await updateRoutingOutcomeQuality({
300
+ agent,
301
+ success,
302
+ durationMs,
303
+ qualityScore: outcome.qualityScore,
304
+ });
305
+ // Stream F (patch 280): Bellman Q-update for the hook-router state.
306
+ // Bridge payload carries the structural state derivation.
307
+ if (outcome.bridge) {
308
+ await updateHookRouterQValue({
309
+ taskType: outcome.bridge.taskType,
310
+ priority: outcome.bridge.priority,
311
+ domain: outcome.bridge.domain,
312
+ complexityBucket: outcome.bridge.complexityBucket,
313
+ agent,
314
+ success,
315
+ });
316
+ }
106
317
  }
107
318
  // Record experience for dream scheduler and check if dream should trigger
108
319
  const projectRoot = findProjectRoot();
@@ -248,7 +248,9 @@ async function runReset(options) {
248
248
  path.join(projectRoot, '.claude', 'settings.json'),
249
249
  ];
250
250
  if (options.all) {
251
- // Also delete data files
251
+ // Also delete data files. patterns.db / trajectories.db are pre-unified
252
+ // legacy paths kept here so `reset --all` still cleans them up on
253
+ // upgraded installs; the live writers all target memory.db now.
252
254
  filesToReset.push(path.join(aqeDir, 'memory.db'), path.join(aqeDir, 'patterns.db'), path.join(aqeDir, 'trajectories.db'), path.join(aqeDir, 'hnsw.index'));
253
255
  }
254
256
  for (const file of filesToReset) {
@@ -69,7 +69,7 @@ export class ClaudeModelProvider extends BaseModelProvider {
69
69
  throw new Error('Claude API key is required. Provide via config.apiKey or ANTHROPIC_API_KEY environment variable.');
70
70
  }
71
71
  this.apiKey = apiKey;
72
- this.baseUrl = config.baseUrl || 'https://api.anthropic.com';
72
+ this.baseUrl = config.baseUrl || process.env.ANTHROPIC_BASE_URL || 'https://api.anthropic.com';
73
73
  this.config = {
74
74
  apiKey,
75
75
  defaultModel: config.defaultModel || 'claude-sonnet-4-6',
@@ -297,9 +297,18 @@ export class DomainTaskExecutor {
297
297
  // Log outcome for debugging and metrics
298
298
  console.debug(`[TaskExecutor] Outcome recorded: task=${task.id}, tier=${tier}, ` +
299
299
  `model=${getModelForTier(tier)}, success=${success}, duration=${durationMs}ms`);
300
- // ADR-023: Record routing outcome for learning feedback loop
300
+ // ADR-023: Record routing outcome for learning feedback loop.
301
+ // qualityScore uses the 6-dim outcome formula (matches the post-task
302
+ // hook UPDATE path) instead of a binary success?0.8:0.2.
301
303
  if (this.qualityFeedbackLoop) {
302
304
  const targetDomains = task.targetDomains || [];
305
+ const successScore = success ? 1 : 0;
306
+ const durationTier = durationMs < 100 ? 1.0 :
307
+ durationMs < 500 ? 0.8 :
308
+ durationMs < 2000 ? 0.6 :
309
+ durationMs < 5000 ? 0.4 :
310
+ durationMs < 10000 ? 0.2 : 0.1;
311
+ const qualityScore = 0.25 * successScore + 0.325 + 0.10 * durationTier;
303
312
  await this.qualityFeedbackLoop.recordRoutingOutcome({
304
313
  taskId: task.id,
305
314
  taskDescription: task.type,
@@ -307,7 +316,7 @@ export class DomainTaskExecutor {
307
316
  usedAgent: String(tier),
308
317
  followedRecommendation: true,
309
318
  success,
310
- qualityScore: success ? 0.8 : 0.2,
319
+ qualityScore,
311
320
  durationMs,
312
321
  timestamp: new Date(),
313
322
  error: success ? undefined : 'Task execution failed',
@@ -439,7 +439,7 @@ if (process.argv.includes('--json')) process.stdout.write(JSON.stringify(result)
439
439
  },
440
440
  // Task routing
441
441
  {
442
- matcher: '^Task$',
442
+ matcher: '^(Task|Agent)$',
443
443
  hooks: [
444
444
  {
445
445
  type: 'command',
@@ -474,7 +474,7 @@ if (process.argv.includes('--json')) process.stdout.write(JSON.stringify(result)
474
474
  ],
475
475
  },
476
476
  {
477
- matcher: '^Task$',
477
+ matcher: '^(Task|Agent)$',
478
478
  hooks: [
479
479
  {
480
480
  type: 'command',
@@ -103,6 +103,88 @@ export class ExperienceReplay {
103
103
  this.prepareStatements();
104
104
  // Load embeddings into memory index
105
105
  await this.loadEmbeddingIndex();
106
+ // Backfill missing embeddings on captured_experiences. Hook-side INSERT
107
+ // paths (sources: cli-hook-post-command, patch-060-post-task, etc.)
108
+ // bypass storeExperience() and never call computeRealEmbedding(),
109
+ // leaving HNSW C cold. Fire-and-forget so init isn't blocked; cap=200
110
+ // per boot to bound work.
111
+ void (async () => {
112
+ try {
113
+ if (!this.db)
114
+ return;
115
+ const ghosts = this.db.prepare(`
116
+ SELECT id, domain, task FROM captured_experiences
117
+ WHERE embedding IS NULL AND consolidated_into IS NULL
118
+ LIMIT 200
119
+ `).all();
120
+ if (ghosts.length === 0)
121
+ return;
122
+ const updateStmt = this.db.prepare(`
123
+ UPDATE captured_experiences
124
+ SET embedding = ?, embedding_dimension = ?
125
+ WHERE id = ?
126
+ `);
127
+ let written = 0;
128
+ for (const row of ghosts) {
129
+ const text = `${row.domain ?? ''}: ${row.task}`.slice(0, 512);
130
+ const embedding = await computeRealEmbedding(text);
131
+ const buf = Buffer.from(new Float32Array(embedding).buffer);
132
+ updateStmt.run(buf, embedding.length, row.id);
133
+ // Add to live HNSW so freshly-embedded rows are immediately searchable
134
+ const hnswId = this.nextHnswId++;
135
+ this.hnswIndex.addEmbedding({
136
+ vector: embedding,
137
+ dimension: 384,
138
+ namespace: 'experiences',
139
+ text: row.id,
140
+ timestamp: Date.now(),
141
+ quantization: 'none',
142
+ metadata: {},
143
+ }, hnswId);
144
+ this.idToExperienceId.set(hnswId, row.id);
145
+ this.experienceIdToHnswId.set(row.id, hnswId);
146
+ written++;
147
+ }
148
+ console.log(`[ExperienceReplay] Backfilled ${written} captured_experiences embeddings`);
149
+ }
150
+ catch (err) {
151
+ console.warn('[ExperienceReplay] Embedding backfill failed:', err instanceof Error ? err.message : err);
152
+ }
153
+ })();
154
+ // Backfill missing embeddings on qe_trajectories. TrajectoryTracker.endTrajectory()
155
+ // writes embedding=NULL with no follow-up worker; hook-side trajectory inserts
156
+ // (cli-hook-post-task) also leave the column NULL. Without this, kNN over
157
+ // historical trajectories collapses to "no candidates" and ReasoningBank
158
+ // can't surface similar past runs. Fail-soft when embedding column is absent
159
+ // (TrajectoryTracker may not have run its schema migration yet).
160
+ void (async () => {
161
+ try {
162
+ if (!this.db)
163
+ return;
164
+ const cols = this.db.prepare("PRAGMA table_info(qe_trajectories)").all();
165
+ if (!cols.some(c => c.name === 'embedding'))
166
+ return;
167
+ const rows = this.db.prepare(`
168
+ SELECT id, domain, task FROM qe_trajectories
169
+ WHERE embedding IS NULL AND ended_at IS NOT NULL
170
+ LIMIT 200
171
+ `).all();
172
+ if (rows.length === 0)
173
+ return;
174
+ const updateStmt = this.db.prepare(`UPDATE qe_trajectories SET embedding = ? WHERE id = ?`);
175
+ let written = 0;
176
+ for (const row of rows) {
177
+ const text = `${row.domain ?? ''}: ${row.task}`.slice(0, 512);
178
+ const embedding = await computeRealEmbedding(text);
179
+ updateStmt.run(Buffer.from(new Float32Array(embedding).buffer), row.id);
180
+ written++;
181
+ }
182
+ console.log(`[ExperienceReplay] Backfilled ${written} qe_trajectories embeddings`);
183
+ }
184
+ catch (err) {
185
+ console.warn('[ExperienceReplay] Trajectory embedding backfill failed:', err instanceof Error ? err.message : err);
186
+ }
187
+ })();
106
188
  // Initialize reservoir buffer if feature flag is enabled (R10, ADR-087)
107
189
  if (getRuVectorFeatureFlags().useReservoirReplay) {
108
190
  this.reservoirBuffer = new ReservoirReplayBuffer({ capacity: 10_000 });
@@ -13,6 +13,7 @@
13
13
  *
14
14
  * @see /docs/plans/GOAP-V3-RUVECTOR-NEURAL-BACKBONE.md
15
15
  */
16
+ import * as nodePath from 'node:path';
16
17
  import { v4 as uuidv4 } from 'uuid';
17
18
  import { HypergraphSchemaManager, nodeToRow, rowToNode, edgeToRow, rowToEdge, generateEdgeId, } from './hypergraph-schema.js';
18
19
  import { toErrorMessage } from '../../shared/error-utils.js';
@@ -515,8 +516,13 @@ export class HypergraphEngine {
515
516
  });
516
517
  }
517
518
  }
518
- // Phase 2: Create entity nodes
519
+ // Phase 2: Create entity nodes + a `contains` edge from the file node
520
+ // to each entity node. Without the contains edge, hypergraph_edges only
521
+ // ever held import edges from Phase 3 — `findUntestedFunctions`,
522
+ // `findImpactedTests`, and `findCoverageGaps` all returned empty
523
+ // regardless of indexing activity.
519
524
  for (const file of indexResult.files) {
525
+ const fileNodeId = `file:${file.path}`;
520
526
  for (const entity of file.entities) {
521
527
  try {
522
528
  const entityId = `${entity.type}:${file.path}:${entity.name}`;
@@ -540,6 +546,21 @@ export class HypergraphEngine {
540
546
  `).run(entityId, nodeType, entity.name, file.path, entity.lineStart, entity.lineEnd, entity.complexity, entity.coverage);
541
547
  nodesCreated++;
542
548
  }
549
+ // file → entity contains edge (idempotent via INSERT OR REPLACE)
550
+ try {
551
+ const containsEdgeId = generateEdgeId(fileNodeId, entityId, 'contains');
552
+ this.config.db.prepare(`
553
+ INSERT OR REPLACE INTO hypergraph_edges (id, source_id, target_id, type, weight)
554
+ VALUES (?, ?, ?, 'contains', 1.0)
555
+ `).run(containsEdgeId, fileNodeId, entityId);
556
+ edgesCreated++;
557
+ }
558
+ catch (edgeError) {
559
+ errors.push({
560
+ entity: `contains:${entity.type}:${entity.name}`,
561
+ error: toErrorMessage(edgeError),
562
+ });
563
+ }
543
564
  }
544
565
  catch (entityError) {
545
566
  errors.push({
@@ -550,13 +571,50 @@ export class HypergraphEngine {
550
571
  }
551
572
  }
552
573
  // Phase 3: Create import edges (now all file nodes exist)
574
+ // Resolves relative paths against the source file's directory and probes
575
+ // common TS/JS/Python extensions (and `/index.ext` for directory imports)
576
+ // so internal imports map to existing hypergraph_nodes. Without this
577
+ // resolver, relative imports never matched any node and 0 edges were
578
+ // ever persisted from intra-repo imports.
579
+ const RESOLVE_EXTENSIONS = ['.ts', '.tsx', '.js', '.jsx', '.py', '.mjs', '.cjs'];
580
+ const RESOLVE_INDEX_FILES = [
581
+ '/index.ts', '/index.tsx', '/index.js', '/index.jsx', '/index.py',
582
+ ];
553
583
  for (const file of indexResult.files) {
554
584
  const fileId = `file:${file.path}`;
555
585
  for (const importPath of file.imports) {
556
586
  try {
557
- const targetId = `file:${importPath}`;
558
- // Check if target node exists (import may reference external module)
559
- const targetExists = this.config.db.prepare('SELECT id FROM hypergraph_nodes WHERE id = ?').get(targetId);
587
+ // Resolve relative imports against the source file's directory
588
+ let resolvedPath = importPath;
589
+ if (importPath.startsWith('./') || importPath.startsWith('../')) {
590
+ resolvedPath = nodePath.resolve(nodePath.dirname(file.path), importPath);
591
+ }
592
+ let targetId = `file:${resolvedPath}`;
593
+ // Check if target node exists; probe extensions and /index.ext
594
+ const lookup = this.config.db.prepare('SELECT id FROM hypergraph_nodes WHERE id = ?');
595
+ let targetExists = lookup.get(targetId);
596
+ if (!targetExists) {
597
+ for (const ext of RESOLVE_EXTENSIONS) {
598
+ const candidate = targetId + ext;
599
+ const hit = lookup.get(candidate);
600
+ if (hit) {
601
+ targetId = candidate;
602
+ targetExists = hit;
603
+ break;
604
+ }
605
+ }
606
+ }
607
+ if (!targetExists) {
608
+ for (const idxFile of RESOLVE_INDEX_FILES) {
609
+ const candidate = targetId + idxFile;
610
+ const hit = lookup.get(candidate);
611
+ if (hit) {
612
+ targetId = candidate;
613
+ targetExists = hit;
614
+ break;
615
+ }
616
+ }
617
+ }
560
618
  if (targetExists) {
561
619
  const edgeId = generateEdgeId(fileId, targetId, 'imports');
562
620
  this.config.db.prepare(`
@@ -665,6 +723,7 @@ export class HypergraphEngine {
665
723
  tests: 0,
666
724
  depends_on: 0,
667
725
  covers: 0,
726
+ contains: 0,
668
727
  };
669
728
  for (const row of edgesByTypeRows) {
670
729
  if (row.type in edgesByType) {
@@ -17,9 +17,13 @@ import type { Database as DatabaseType } from 'better-sqlite3';
17
17
  */
18
18
  export type NodeType = 'function' | 'module' | 'test' | 'file' | 'class';
19
19
  /**
20
- * Valid edge types in the hypergraph
20
+ * Valid edge types in the hypergraph.
21
+ *
22
+ * - `contains`: file → entity (function/class/etc) containment edge.
23
+ * Without this, `findUntestedFunctions`, `findImpactedTests`, and
24
+ * `findCoverageGaps` return empty regardless of indexing activity.
21
25
  */
22
- export type EdgeType = 'calls' | 'imports' | 'tests' | 'depends_on' | 'covers';
26
+ export type EdgeType = 'calls' | 'imports' | 'tests' | 'depends_on' | 'covers' | 'contains';
23
27
  /**
24
28
  * Represents a node in the hypergraph (code entity)
25
29
  */